disable onnx export optimizer for 0.5.0 (#573)

pull/576/head
q.yao 2022-06-08 17:33:38 +08:00 committed by GitHub
parent 594c835b6b
commit 59ed27e2f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ void RemoveReshapeChain(Node* node) {
auto uses = output->uses();
for (auto use : uses) {
if (is_kind(use.user, "onnx::Reshape") || use.offset != 0) {
if (!is_kind(use.user, "onnx::Reshape") || use.offset != 0) {
return;
}
}

View File

@ -25,7 +25,7 @@ def export(model: torch.nn.Module,
dynamic_axes: Optional[Dict] = None,
verbose: bool = False,
keep_initializers_as_inputs: Optional[bool] = None,
optimize: bool = True,
optimize: bool = False,
**kwargs):
"""Export a PyTorch model into ONNX format. This is a wrap of
`torch.onnx.export` with some enhancement.