'helper method to check whether the definition
dictionary is defining a NervanaObject child,
if so it will instantiate that object and replace
the dictionary element with an instance of that object'

@staticmethod
def recursive_gen(pdict, key):

    if ((type(pdict[key]) is dict) and ('type' in pdict[key])):
        if ('config' not in pdict[key]):
            pdict[key]['config'] = {}
        ccls = load_class(pdict[key]['type'])
        pdict[key] = ccls.gen_class(pdict[key]['config'])
