嘉渊
2023-04-24 6427c834dfd97b1f05c6659cdc7ccf010bf82fe1
funasr/models/encoder/resnet34_encoder.py
@@ -1,8 +1,8 @@
import torch
from torch.nn import functional as F
from funasr.models.encoder.abs_encoder import AbsEncoder
from typing import Tuple, Optional
from funasr.models.pooling.statistic_pooling import statistic_pooling, windowed_statistic_pooling
from funasr.models.encoder.abs_encoder import AbsEncoder
from collections import OrderedDict
import logging
import numpy as np
@@ -76,7 +76,7 @@
        return xs_pad, ilens
class ResNet34(AbsEncoder):
class ResNet34(torch.nn.Module):
    def __init__(
            self,
            input_size,
@@ -831,7 +831,7 @@
                            name, data_tf.size(), name_tf, var_dict_tf[name_tf].shape
                        ))
                    else:
                        var_dict_torch_update[name] = torch.Tensor(map_dict[name]).type(torch.int64).to("cpu")
                        var_dict_torch_update[name] = torch.from_numpy(np.array(map_dict[name])).type(torch.int64).to("cpu")
                        logging.info("torch tensor: {}, manually assigning to: {}".format(
                            name, map_dict[name]
                        ))