mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[binaries] fix dump_operator_name binary (#71246)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/71246 Test Plan: Imported from OSS Reviewed By: malfet Differential Revision: D33555962 Pulled By: IvanKobzarev fbshipit-source-id: 2b386e52fa8e76c877fec5b6b15d99f7d280801f (cherry picked from commit f6d60fdff68964f77aa46ca2c51327cb66566194)
This commit is contained in:
committed by
PyTorch MergeBot
parent
89c844db9b
commit
4868907cf3
@ -29,7 +29,8 @@ void dump_opnames(const Module& m, std::unordered_set<std::string>& opnames) {
|
||||
for (const auto& method : methods) {
|
||||
const auto& func = method.function();
|
||||
std::cout << "function name: " << func.name() << std::endl;
|
||||
torch::jit::Code code(func.graph(), "");
|
||||
auto graph = toGraphFunction(func).graph()->copy();
|
||||
torch::jit::Code code(graph, "");
|
||||
for (size_t i = 0; i < code.instructions().size(); ++i) {
|
||||
auto ins = code.instructions()[i];
|
||||
auto node = code.instructions_source()[i];
|
||||
|
Reference in New Issue
Block a user