- class Model(torch.nn.Module):
- def __init__(self):
- super(Model, self).__init__()
- self.weights_0 = torch.nn.Parameter(torch.ones(1))
- self.weights_1 = torch.nn.Parameter(torch.ones(1))
- def forward(self, input_0, input_1):
- result = torch.mul(self.weights_0 , input_0) + torch.mul(self.weights_1 , input_1)
- return result
复制代码
模型里需要通过 torch.nn.Parameter 的方式定义可学习参数,但是上面这个模型在 torch -> rknn 的时候会报错如下:WARNING: Token 'COMMENT' defined, but not usedjefferyzhang 发表于 2020-5-13 17:57
W Not match tensor little_model_param.weights_0ut0
就是指这个op不支持。这名字看过去就不是通用的OP, ...
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |