Skip to content

Commit

Permalink
To fix caffe2 model with Copy OP cannot export to onnx model (pytorch…
Browse files Browse the repository at this point in the history
…#37144)

Summary:
To fix caffe2 model with Copy OP cannot export to onnx model
Pull Request resolved: pytorch#37144

Reviewed By: houseroad

Differential Revision: D21252421

Pulled By: yinghai

fbshipit-source-id: 4f1077188f36b0691d199e418880bbb27f11032d
  • Loading branch information
mpjlu authored and facebook-github-bot committed May 4, 2020
1 parent 1bac49f commit 6dd1bea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion caffe2/onnx/onnx_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ OnnxExporter::get_renamed_operators() const {
{"MaxPool3D", "MaxPool"},
{"AveragePool1D", "AveragePool"},
{"AveragePool2D", "AveragePool"},
{"AveragePool3D", "AveragePool"}};
{"AveragePool3D", "AveragePool"},
{"Copy", "Identity"}};
return kRenamedOperators;
}

Expand Down
1 change: 1 addition & 0 deletions caffe2/operators/copy_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ OPERATOR_SCHEMA(Copy)
.NumOutputs(1)
.IdenticalTypeAndShape()
.InputsCanCrossDevices()
.InheritOnnxSchema("Identity")
.SetDoc(R"DOC(
Copy input tensor into output, potentially across devices.
Expand Down

0 comments on commit 6dd1bea

Please sign in to comment.