class_docstr: This class handles iteration events to update the model with gradient op
  (by setting iteration message with a 'gradients' op at the beginning of
  each iteration).
class_docstr_tok: ["This","class","handles","iteration","events","to","update","the","model","with","gradient","op","(","by","setting","iteration","message","with","a","'gradients","'","op","at","the","beginning","of","each","iteration",")","."]
code: def __init__(self, is_training_action=False, **_unused):
      if not is_training_action:
          return
      GRAPH_CREATED.connect(self.make_gradients_op)
      ITER_STARTED.connect(self.add_gradients)
  
file_path: NiftyNet/niftynet/engine/handler_gradient.py
imports: import tensorflow
  from niftynet.engine.signal import ITER_STARTED, GRAPH_CREATED
  from niftynet.layer.bn import BN_COLLECTION
  from niftynet.utilities import util_common
label_desc: Use image node_id 1 to create a new ApplyGradients object from inherited base classes: object with example: obj = ApplyGradients(is_training_action)