Clarify OpDef.is_stateful flag definition
authorIgor Ganichev <iga@google.com>
Tue, 3 Apr 2018 05:24:14 +0000 (22:24 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Tue, 3 Apr 2018 05:26:37 +0000 (22:26 -0700)
PiperOrigin-RevId: 191396824

tensorflow/core/framework/op_def.proto

index ba545a1..ca0e5e7 100644 (file)
@@ -126,6 +126,12 @@ message OpDef {
   // -------------------------------------------------------------------------
   // Optimization constraints.
 
+  // Ops are marked as stateful if their behavior depends on some state beyond
+  // their input tensors (e.g. variable reading op) or if they have
+  // a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
+  // must always produce the same output for the same input and have
+  // no side-effects.
+  //
   // By default Ops may be moved between devices.  Stateful ops should
   // either not be moved, or should only be moved if that state can also
   // be moved (e.g. via some sort of save / restore).