Skip to content

[C2][ONNX] Dont assume serialized integral types were widened to int32 in raw_data#10718

Closed
jamesr66a wants to merge 2 commits intopytorch:masterfrom
jamesr66a:fix_onnx_import_c2
Closed

[C2][ONNX] Dont assume serialized integral types were widened to int32 in raw_data#10718
jamesr66a wants to merge 2 commits intopytorch:masterfrom
jamesr66a:fix_onnx_import_c2

Conversation

@jamesr66a
Copy link
Collaborator

@jamesr66a jamesr66a commented Aug 21, 2018

@zdevito et al came to the conclusion that the ONNX spec does not mandate the widening conversion of integral types when serializing tensor data into raw_data, as opposed to serializing the data into int32_data. PyTorch recently made this change in the export code, which caused import in caffe2 to break because it did not match semantics. This fixes that

@jamesr66a jamesr66a force-pushed the fix_onnx_import_c2 branch 2 times, most recently from e9b77ba to cd5e24a Compare August 21, 2018 03:44
@jamesr66a jamesr66a changed the title [C2][ONNX] Dont assume serialized integral types are widened to int32 in raw_data [C2][ONNX] Dont assume serialized integral types were widened to int32 in raw_data Aug 21, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jamesr66a has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Member

@houseroad houseroad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good. Can you also add int64 support? probably a better name. :-)

c2_values->add_ints(i);
}
} else {
const ::google::protobuf::RepeatedField<::google::protobuf::int32> *int32_src = \

This comment was marked as off-topic.

Copy link
Member

@houseroad houseroad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jamesr66a has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

PenghuiCheng pushed a commit to PenghuiCheng/pytorch that referenced this pull request Sep 11, 2018
…ta (pytorch#10718)

Summary:
zdevito et al came to the conclusion that the ONNX spec does not mandate the widening conversion of integral types when serializing tensor data into raw_data, as opposed to serializing the data into int32_data. PyTorch recently made this change in the export code, which caused import in caffe2 to break because it did not match semantics. This fixes that
Pull Request resolved: pytorch#10718

Differential Revision: D9423712

Pulled By: jamesr66a

fbshipit-source-id: 479fbae67b028bf4f9c1ca1812c2c7b0c6cccd12
@ezyang ezyang added the merged label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants