summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAdam Paszke <apaszke@fb.com>2018-09-21 08:24:14 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-09-21 08:40:20 -0700
commite655f16c354aae5757e11c18d0633792ac83a326 (patch)
treeb7f0856373cd0bcd092572aff1dab266572b438e /tools
parent4fb7e72fe5969b9de7dde1fbc4499eb1dc8486c8 (diff)
downloadpytorch-e655f16c354aae5757e11c18d0633792ac83a326.tar.gz
pytorch-e655f16c354aae5757e11c18d0633792ac83a326.tar.bz2
pytorch-e655f16c354aae5757e11c18d0633792ac83a326.zip
Pop stashed IntList in resize_, warn about its usage when tracing.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/11909 Differential Revision: D9979595 fbshipit-source-id: 07b1027bd6bd1605a31afd4f57bcd58e307fa41e
Diffstat (limited to 'tools')
-rw-r--r--tools/autograd/templates/VariableType.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/autograd/templates/VariableType.cpp b/tools/autograd/templates/VariableType.cpp
index 6bd409ad0a..d697ec8a77 100644
--- a/tools/autograd/templates/VariableType.cpp
+++ b/tools/autograd/templates/VariableType.cpp
@@ -434,6 +434,11 @@ Tensor & VariableType::resize_(Tensor & self, IntList size) const {
if (as_variable_ref(self).requires_grad()) {
AT_ERROR("cannot resize variables that require grad");
}
+ if (torch::jit::tracer::isTracing()) {
+ jit::tracer::ArgumentStash::popIntList("size");
+ jit::tracer::warn("resize_", jit::tracer::WARN_RESIZE);
+ jit::tracer::delValueTrace(self);
+ }
baseType->resize_(self_, size);
return self;
}
@@ -444,6 +449,10 @@ Tensor & VariableType::resize_as_(Tensor & self, const Tensor & the_template) co
if (as_variable_ref(self).requires_grad()) {
AT_ERROR("cannot resize variables that require grad");
}
+ if (torch::jit::tracer::isTracing()) {
+ jit::tracer::warn("resize_as_", jit::tracer::WARN_RESIZE);
+ jit::tracer::delValueTrace(self);
+ }
baseType->resize_as_(self_, the_template_);
return self;
}