To fix caffe2 model with Copy OP cannot export to onnx model (#37144)

Summary:
To fix caffe2 model with Copy OP cannot export to onnx model
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37144

Reviewed By: houseroad

Differential Revision: D21252421

Pulled By: yinghai

fbshipit-source-id: 4f1077188f36b0691d199e418880bbb27f11032d
This commit is contained in:
peng 2020-05-04 11:31:34 -07:00 committed by Facebook GitHub Bot
parent 1bac49f075
commit 6dd1beaaa8
2 changed files with 3 additions and 1 deletions

View File

@ -371,7 +371,8 @@ OnnxExporter::get_renamed_operators() const {
{"MaxPool3D", "MaxPool"},
{"AveragePool1D", "AveragePool"},
{"AveragePool2D", "AveragePool"},
{"AveragePool3D", "AveragePool"}};
{"AveragePool3D", "AveragePool"},
{"Copy", "Identity"}};
return kRenamedOperators;
}

View File

@ -16,6 +16,7 @@ OPERATOR_SCHEMA(Copy)
.NumOutputs(1)
.IdenticalTypeAndShape()
.InputsCanCrossDevices()
.InheritOnnxSchema("Identity")
.SetDoc(R"DOC(
Copy input tensor into output, potentially across devices.