1 #include <torch/csrc/jit/ir.h> 8 AT_ASSERT(node->kind() == ::c10::prim::If);
11 return node_->input(0);
13 Block* thenBlock()
const {
14 return node_->blocks().at(0);
16 Block* elseBlock()
const {
17 return node_->blocks().at(1);
20 return thenBlock()->outputs();
23 return elseBlock()->outputs();
26 return node_->outputs();
31 operator Node*()
const {
42 node->kind() == ::c10::prim::Loop || node->kind() == ::c10::onnx::Loop);
44 Block* bodyBlock()
const {
45 return node_->blocks().at(0);
48 return node_->input(0);
50 Value* maxTripCount()
const {
51 return node_->input(0);
53 Value* inputCond()
const {
54 return node_->input(1);
56 Value* nextCond()
const {
57 return bodyBlock()->outputs().at(0);
59 Value* currentTripCount()
const {
60 return bodyBlock()->inputs().at(0);
64 return node_->inputs().
slice(2);
67 return node_->outputs();
71 return bodyBlock()->inputs().
slice(1);
74 return bodyBlock()->outputs().
slice(1);
79 operator Node*()
const {
AT_CPP14_CONSTEXPR ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...