pytorch/test/cpp
Bin Bao ac37ddc795 [LT] Store OpKind for each IR subclass in a static field
Summary: Currently OpKind is stored as an object field called op_ for each IR
node, and one usage of op_ is to avoid dynamic_cast in NodeCast when we
need to downcast a base-node pointer into a concrete sub-node pointer.
As a result, we need to construct and pass in an op when downcasting
nodes, and this becomes quite anonnying when we start to implement the
trie-based IR node reusing. More importantly, the op for each subclass
should be unique for that subclass and thus making it a const static field
is a more logical design.

In this PR, we still keep the object-level op_ for easier XLA adoption. As
furture work, we can come back to remove op_, make the op() method
virtual, and get rid of OpKind in all the node constructors.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76711

Approved by: https://github.com/wconstab, https://github.com/JackCaoG
2022-05-06 19:14:46 +00:00
..
api Extend jit::load to work on flatbuffer file; Take 2 (#75256) 2022-04-06 17:54:01 +00:00
c10d Add cuda-11.3+clang9 build workflow (take 2) 2022-04-11 17:13:01 +00:00
common
dist_autograd
jit [NVFuser] prep for on-by-default 2022-05-06 18:18:53 +00:00
lazy [LT] Store OpKind for each IR subclass in a static field 2022-05-06 19:14:46 +00:00
lite_interpreter_runtime
monitor
profiler [RecordFunction] More effecient machinery to determine which callbacks to run. (#75807) 2022-04-19 20:46:16 +00:00
rpc
tensorexpr [NNC] Lowering function generates the output buffer with the specified stride (#76529) 2022-05-04 20:04:22 +00:00
__init__.py