# automatically generated by the FlatBuffers compiler, do not modify

# namespace: Dl

class TypeInfoValue(object):
    NONE = 0
    tensor_type = 1
    sequence_type = 2
    map_type = 3
    optional_type = 4

def TypeInfoValueCreator(unionType, table):
    from flatbuffers.table import Table
    if not isinstance(table, Table):
        return None
    if unionType == TypeInfoValue().tensor_type:
        import FlatBuffers.Dl.TensorTypeAndShape
        return FlatBuffers.Dl.TensorTypeAndShape.TensorTypeAndShapeT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == TypeInfoValue().sequence_type:
        import FlatBuffers.Dl.SequenceType
        return FlatBuffers.Dl.SequenceType.SequenceTypeT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == TypeInfoValue().map_type:
        import FlatBuffers.Dl.MapType
        return FlatBuffers.Dl.MapType.MapTypeT.InitFromBuf(table.Bytes, table.Pos)
    if unionType == TypeInfoValue().optional_type:
        import FlatBuffers.Dl.OptionalType
        return FlatBuffers.Dl.OptionalType.OptionalTypeT.InitFromBuf(table.Bytes, table.Pos)
    return None
