mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 21:49:24 +08:00
Enable numel tracing
clang-format resolve onnx test failure update expect file Pull Request resolved: https://github.com/pytorch/pytorch/pull/74081 Approved by: https://github.com/garymm, https://github.com/eellison, https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
db20a3b014
commit
aa51ee2345
@ -231,7 +231,11 @@ static PyObject * THPVariable_numel(PyObject* self, PyObject* args)
|
||||
return handle_torch_function(self, "numel", args);
|
||||
}
|
||||
auto& self_ = THPVariable_Unpack(self);
|
||||
return THPUtils_packInt64(self_.numel());
|
||||
if (jit::tracer::isTracing()) {
|
||||
return wrap(jit::tracer::getNumelOf(self_));
|
||||
} else {
|
||||
return THPUtils_packInt64(self_.numel());
|
||||
}
|
||||
END_HANDLE_TH_ERRORS
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user