summaryrefslogtreecommitdiff
path: root/torch/csrc/jit/ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'torch/csrc/jit/ir.cpp')
-rw-r--r--torch/csrc/jit/ir.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/torch/csrc/jit/ir.cpp b/torch/csrc/jit/ir.cpp
index 650d5ef55c..df038e32e4 100644
--- a/torch/csrc/jit/ir.cpp
+++ b/torch/csrc/jit/ir.cpp
@@ -686,6 +686,17 @@ bool Node::isNondeterministic() const {
return true;
}
+bool Node::hasSideEffects() const {
+ switch (kind_) {
+ case prim::PythonOp:
+ case prim::Print:
+ case prim::RaiseException:
+ case aten::warn:
+ return true;
+ }
+ return false;
+}
+
// Assign this node a topological position, to facilitate fast isBefore() and
// isAfter() queries. Must be called right after a node is inserted into the
// node list.