class_docstr: Base class for modules.
  
  Args:
      device (string): Device name
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      l2_regularization (float >= 0.0): Scalar controlling L2 regularization
          (<span style="color:#00C000"><b>default</b></span>: inherit value of parent module).
      name (string): <span style="color:#0000C0"><b>internal use</b></span>.
code: def summary(self, *, label, name, data, step):
      # label
      if not isinstance(label, str):
          raise TensorforceError.type(
              name="Module.summary", argument="label", dtype=type(label)
          )
      # name
      if not isinstance(name, (str, tuple, list)):
          raise TensorforceError.type(
              name="Module.summary", argument="name", dtype=type(name)
          )
      if isinstance(name, str):
          names = None
      else:
          names = name
          name = name[0]
      # data
      if not tf_util.is_tensor(x=data) and not callable(data):
          raise TensorforceError.type(
              name="Module.summary", argument="data", dtype=type(data)
          )
      # step
      if step not in self.root.units:
          raise TensorforceError.value(
              name="Module.summary", argument="step", value=step
          )
  
      if self.root.summaries == "all" or label in self.root.summaries:
          if name not in self.summary_steps:
              raise TensorforceError.value(
                  name="Module.summary",
                  argument="name",
                  value=name,
                  hint="is not registered",
              )
  
          unit = self.root.units[step]
  
          def fn_summary():
              if callable(data):
                  value = data()
              else:
                  value = data
              dependencies = list()
              with self.root.summarizer.as_default():
                  if names is None:
                      dependencies.append(
                          tf.summary.scalar(
                              name=name, data=value, step=unit
                          )
                      )
                  else:
                      for n, x in zip(names, value):
                          dependencies.append(
                              tf.summary.scalar(
                                  name=n, data=x, step=unit
                              )
                          )
              previous = self.summary_steps[name]
              dependencies.append(
                  previous.assign(value=unit, read_value=False)
              )
              return tf.group(*dependencies)
  
          pred = unit > self.summary_steps[name]
          return [
              tf.cond(pred=pred, true_fn=fn_summary, false_fn=tf.no_op)
          ]
  
      else:
          return list()
  
imports: import functools
  import json
  import os
  import re
  import numpy
  import tensorflow
  from tensorforce import TensorforceError, util
  import tensorforce.core
  from tensorforce.core import SignatureDict, TensorSpec, tf_util, VariableDict
label_desc: Use image node_id 23 for calling the Module obj's underlying member method code with example usage: obj.summary() and returns: list, list, tf