class_docstr: Accumulates gradients during a fit() call when used in conjunction with the CustomOptimizer above.
class_docstr_tok: ["Accumulates","gradients","during","a","fit","(",")","call","when","used","in","conjunction","with","the","CustomOptimizer","above","."]
code: def set_model(self, model):
      super().set_model(model)
      self.og_weights = model.get_weights()
      self.grads = [
          np.zeros(tuple(w.shape)) for w in model.trainable_weights
      ]
  
imports: import logging
  import operator
  import os
  import shutil
  import sys
  from itertools import chain
  import numpy
  import tensorflow
  import tensorflow.keras.backend
  import wandb
  from wandb.sdk.integration_utils.data_logging import ValidationDataLogger
  from wandb.sdk.lib.deprecate import Deprecated, deprecate
  from wandb.util import add_import_hook
label_desc: Use image node_id 1 for calling the _GradAccumulatorCallback obj's underlying member method code with example usage: obj.set_model(model) without return types