piiswrong commented on a change in pull request #7356: decouple record/train 
and add state readers
URL: https://github.com/apache/incubator-mxnet/pull/7356#discussion_r131980315
 
 

 ##########
 File path: python/mxnet/autograd.py
 ##########
 @@ -106,10 +135,41 @@ def pause(is_train=False):
 
     Parameters
     ----------
-    is_train: bool, default False
-        Whether to do forward for training or inference.
+    train_mode: bool, default False
+        Whether to do forward for training or predicting.
+    """
+    return _RecordingStateScope(False, train_mode)
+
+
+def train_mode():
+    """Returns a scope context to be used in 'with' statement
+    in which forward pass behavior is set to training mode,
+    without changing the recording states.
+
+    Example::
+
+        y = model(x)
+        with autograd.train():
 
 Review comment:
   train_mode
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to