Back out "Revert D38984222: Don't introduce new overload for SymInt (#83628)" (#84173)

Also Back out "Revert D39075159: [acc_tensor] Use SymIntArrayRef for overloaded empty.memory_format's signature"

Original commit changeset: dab4a9dba4fa
Original commit changeset: dcaf16c037a9

Original Phabricator Diff: D38984222
Original Phabricator Diff: D39075159

Also update Metal registrations for C++ registration changes.

Also update NNPI registration to account for tightened schema checking

Differential Revision: [D39084762](https://our.internmc.facebook.com/intern/diff/D39084762/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D39084762/)!
Pull Request resolved: https://github.com/pytorch/pytorch/pull/84173
Approved by: https://github.com/Krovatkin
This commit is contained in:
Edward Z. Yang
2022-08-29 06:08:43 -07:00
committed by PyTorch MergeBot
parent cfd18e105f
commit ad44670fa1
89 changed files with 862 additions and 747 deletions

View File

@@ -45,6 +45,20 @@ TEST(CustomClassTest, TorchbindIValueAPI) {
test_with_obj(new_stack_ivalue, "boo");
}
TEST(CustomClassTest, ScalarTypeClass) {
script::Module m("m");
// test make_custom_class API
auto cc = make_custom_class<ScalarTypeClass>(at::kFloat);
m.register_attribute("s", cc.type(), cc, false);
std::ostringstream oss;
m.save(oss);
std::istringstream iss(oss.str());
caffe2::serialize::IStreamAdapter adapter{&iss};
auto loaded_module = torch::jit::load(iss, torch::kCPU);
}
class TorchBindTestClass : public torch::jit::CustomClassHolder {
public:
std::string get() {