pytorch模型转onnx模型trace方式和script方式
1、编写模型
# -*- coding : UTF-8 -*-
# @file : model_authoring.py
# @Time : 2021/11/29 0029 21:53
# @Author : wmz
import torch # This is all you need to use both PyTorch and TorchScript!
print(torch.__version__)
# class MyCell(torch.nn.Module):
# def __init__(self):
# super(MyCell, self).__init__()
#
# def forward(self, x, h):