(pdict, key)
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
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
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
def recursive_gen(pdict, key):
        """
        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
        """
        if type(pdict[key]) is dict and 'type' in pdict[key]:
            if 'config' not in pdict[key]:
                # assume empty params if 'config' key missing
                # needed to keep yaml deserialization short
                pdict[key]['config'] = {}
            ccls = load_class(pdict[key]['type'])
            pdict[key] = ccls.gen_class(pdict[key]['config'])
def recursive_gen ( pdict , key ) : if type ( pdict [ key ] ) is dict and 'type' in pdict [ key ] : if 'config' not in pdict [ key ] : # assume empty params if 'config' key missing # needed to keep yaml deserialization short pdict [ key ] [ 'config' ] = { } ccls = load_class ( pdict [ key ] [ 'type' ] ) pdict [ key ] = ccls . gen_class ( pdict [ key ] [ 'config' ] )