def load_kaldi_model(graph, nnet_path):
    '\n    Structure of the file is the following:\n    magic-number(16896)<Nnet> <Next Layer Name> weights etc.\n    :param nnet_path:\n    :return:\n    '
    nnet_name = None
    if isinstance(nnet_path, str):
        file_desc = open(nnet_path, 'rb')
        nnet_name = get_name_from_path(nnet_path)
    elif isinstance(nnet_path, IOBase):
        file_desc = nnet_path
    else:
        raise Error('Unsupported type of Kaldi model')
    tag = find_next_tag(file_desc)
    if (tag == '<Nnet>'):
        load_function = load_kalid_nnet1_model
    elif (tag == '<TransitionModel>'):
        while ((tag != '<Nnet>') and (tag != '<Nnet3>')):
            tag = find_next_tag(file_desc)
        if (tag == '<Nnet3>'):
            load_function = load_kaldi_nnet3_model
        else:
            load_function = load_kalid_nnet2_model
    elif (tag == '<Nnet3>'):
        load_function = load_kaldi_nnet3_model
    else:
        raise Error('Kaldi model should start with <Nnet> or <TransitionModel> tag. ', refer_to_faq_msg(89))
    read_placeholder(file_desc, 1)
    return load_function(graph, file_desc, nnet_name)
Structure of the file is the following:
magic-number(16896)<Nnet> <Next Layer Name> weights etc.
:param nnet_path:
:return:
def load_kaldi_model(graph, nnet_path):
    '\n    Structure of the file is the following:\n    magic-number(16896)<Nnet> <Next Layer Name> weights etc.\n    :param nnet_path:\n    :return:\n    '
    nnet_name = None
    if isinstance(nnet_path, str):
        file_desc = open(nnet_path, 'rb')
        nnet_name = get_name_from_path(nnet_path)
    elif isinstance(nnet_path, IOBase):
        file_desc = nnet_path
    else:
        raise Error('Unsupported type of Kaldi model')
    tag = find_next_tag(file_desc)
    if (tag == '<Nnet>'):
        load_function = load_kalid_nnet1_model
    elif (tag == '<TransitionModel>'):
        while ((tag != '<Nnet>') and (tag != '<Nnet3>')):
            tag = find_next_tag(file_desc)
        if (tag == '<Nnet3>'):
            load_function = load_kaldi_nnet3_model
        else:
            load_function = load_kalid_nnet2_model
    elif (tag == '<Nnet3>'):
        load_function = load_kaldi_nnet3_model
    else:
        raise Error('Kaldi model should start with <Nnet> or <TransitionModel> tag. ', refer_to_faq_msg(89))
    read_placeholder(file_desc, 1)
    return load_function(graph, file_desc, nnet_name)