mirror of
https://github.com/zebrajr/pytorch.git
synced 2026-01-15 12:15:51 +00:00
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:
committed by
PyTorch MergeBot
parent
cfd18e105f
commit
ad44670fa1
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user