def buildSequential(self, conf: dict):
    oSeq = self.Lib.nn.Sequential()
    ModelConfList = conf['Model']
    for (idx, ModelConf) in enumerate(ModelConfList):
        CModule = self._getNNAttr(ModelConf[0])
        attr = ModelConf[1]
        oModule = None
        name = str(idx)
        if ((len(ModelConf) > 2) and (type(ModelConf[2]) == dict)):
            'if contain aux attribute'
            auxAttr = ModelConf[2]
            if (auxAttr.get('name') != None):
                ' if aux attribute contain name attribute'
                name = auxAttr['name']
        if (type(attr) == list):
            if (len(attr) == 0):
                oModule = CModule()
            elif ((type(attr[0]) == list) and (type(attr[1]) == dict)):
                self._subListToTuple(attr[0])
                self._subListToTuple(attr[1])
                oModule = CModule(*attr[0], **attr[1])
            elif any(((type(x) not in [int, float, str, bool, list]) for x in attr)):
                raise ValueError(('attribute of Module %s (index %d) is invalid' % (ModelConf[0], idx)))
            else:
                self._subListToTuple(attr)
                oModule = CModule(*attr)
        elif (type(attr) == dict):
            self._subListToTuple(attr)
            oModule = CModule(**attr)
        else:
            raise ValueError(('attribute of Module %s (index %d) is invalid' % (ModelConf[0], idx)))
        oSeq.add_module(name, oModule)
    return oSeq
def buildSequential(self, conf: dict):
    oSeq = self.Lib.nn.Sequential()
    ModelConfList = conf['Model']
    for (idx, ModelConf) in enumerate(ModelConfList):
        CModule = self._getNNAttr(ModelConf[0])
        attr = ModelConf[1]
        oModule = None
        name = str(idx)
        if ((len(ModelConf) > 2) and (type(ModelConf[2]) == dict)):
            'if contain aux attribute'
            auxAttr = ModelConf[2]
            if (auxAttr.get('name') != None):
                ' if aux attribute contain name attribute'
                name = auxAttr['name']
        if (type(attr) == list):
            if (len(attr) == 0):
                oModule = CModule()
            elif ((type(attr[0]) == list) and (type(attr[1]) == dict)):
                self._subListToTuple(attr[0])
                self._subListToTuple(attr[1])
                oModule = CModule(*attr[0], **attr[1])
            elif any(((type(x) not in [int, float, str, bool, list]) for x in attr)):
                raise ValueError(('attribute of Module %s (index %d) is invalid' % (ModelConf[0], idx)))
            else:
                self._subListToTuple(attr)
                oModule = CModule(*attr)
        elif (type(attr) == dict):
            self._subListToTuple(attr)
            oModule = CModule(**attr)
        else:
            raise ValueError(('attribute of Module %s (index %d) is invalid' % (ModelConf[0], idx)))
        oSeq.add_module(name, oModule)
    return oSeq