Skip to content

Add safety asserts for methods on TensorImpl which don't work on Variable.#12058

Closed
ezyang wants to merge 1 commit intomasterfrom
export-D10034589
Closed

Add safety asserts for methods on TensorImpl which don't work on Variable.#12058
ezyang wants to merge 1 commit intomasterfrom
export-D10034589

Conversation

@ezyang
Copy link
Contributor

@ezyang ezyang commented Sep 25, 2018

Stack:
    :black_circle:  #12058 Add safety asserts for methods on TensorImpl which don't work on Variable.  💛

Methods on TensorImpl have to be written very carefully, because
when you have a VariableImpl subclass of TensorImpl, usually the
local fields on the TensorImpl are not valid; instead, you have to
forward to the "wrapped" tensor. Functions which are virtualized
are probably handled correctly by Variable, but functions which
are NOT cannot be handled correctly and shouldn't be called if you
have a Variable. This diff add checks to determine if this is
the case or not.

Differential Revision: D10034589

Differential Revision: D10034589
Differential Version: 58823877
zdevito pushed a commit to zdevito/ATen that referenced this pull request Sep 26, 2018
…able. (#12058)

Summary:
Pull Request resolved: pytorch/pytorch#12058

Methods on TensorImpl have to be written very carefully, because
when you have a VariableImpl subclass of TensorImpl, usually the
local fields on the TensorImpl are not valid; instead, you have to
forward to the "wrapped" tensor.  Functions which are virtualized
are probably handled correctly by Variable, but functions which
are NOT cannot be handled correctly and shouldn't be called if you
have a Variable.  This diff add checks to determine if this is
the case or not.

Reviewed By: jerryzh168

Differential Revision: D10034589

fbshipit-source-id: 650b2036ca9a044c0ab4abdf6f825521a64e1fc2
Copy link
Contributor

@gchanan gchanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

petrex pushed a commit to petrex/pytorch that referenced this pull request Sep 26, 2018
* upstream/master: (117 commits)
  Add full namespace resolution in CAFFE_DURATION (pytorch#12065)
  T33898723: Simple put operators for caffe2 stats (pytorch#12057)
  add narrow() support for sparse tensors re: pytorch#8853 (pytorch#11342)
  Fix ONNX bug, add symbolic for full
  Enable tracing of tensor factories with an out argument
  Fix warnings emitted when testing distributions (pytorch#12038)
  Unify versions across setup.py, libtorch, and libcaffe2 (pytorch#12053)
  add autodiff expressions for common operations (pytorch#11832)
  Blob doesn't allow access to destroyCall anymore (pytorch#11548)
  IValue can store Blob (pytorch#11414)
  Move Blob to ATen/core (pytorch#11924)
  Use tempfile during serialized test comparison (pytorch#12021)
  fix segfault when grad to a hook fn is None (pytorch#12028)
  Fallback CreateMutex/AtomicIter operators for mkl-dnn
  Unify all *_EXPORT and *_IMPORT macros across c++ backend (pytorch#12019)
  Add safety asserts for methods on TensorImpl which don't work on Variable. (pytorch#12058)
  Make USE_IDEEP work again (pytorch#12026)
  Fix "identifier following the 'template' keyword does not refer to a template" (pytorch#12037)
  Delete some unused variables. (pytorch#12059)
  Support TypeIdentifier::name() (pytorch#12036)
  ...
@soumith soumith deleted the export-D10034589 branch February 21, 2019 12:10
@ezyang ezyang added the merged label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants