class_docstr: Meta class for Network object.
  
  We mainly use this class to capture all args to `__init__` of all `Network`
  instances, and store them in `instance._saved_kwargs`.  This in turn is
  used by the `instance.copy` method.
class_docstr_tok: ["Meta","class","for","Network","object",".","We","mainly","use","this","class","to","capture","all","args","to","`","__init__","`","of","all","`","Network","`","instances",",","and","store","them","in","`","instance._saved_kwargs","`",".","This","in","turn","is","used","by","the","`","instance.copy","`","method","."]
docstr: Control the creation of subclasses of the Network class.
  
  Args:
    classname: The name of the subclass being created.
    baseclasses: A tuple of parent classes.
    attrs: A dict mapping new attributes to their values.
  
  Returns:
    The class object.
  
  Raises:
    RuntimeError: if the class __init__ has *args in its signature.
docstr_tok: ["Control","the","creation","of","subclasses","of","the","Network","class",".","Args",":","classname",":","The","name","of","the","subclass","being","created",".","baseclasses",":","A","tuple","of","parent","classes",".","attrs",":","A","dict","mapping","new","attributes","to","their","values",".","Returns",":","The","class","object",".","Raises",":","RuntimeError",":","if","the","class","__init__","has","*","args","in","its","signature","."]
code: def __new__(mcs, classname, baseclasses, attrs):
      """Control the creation of subclasses of the Network class.
  
      Args:
        classname: The name of the subclass being created.
        baseclasses: A tuple of parent classes.
        attrs: A dict mapping new attributes to their values.
  
      Returns:
        The class object.
  
      Raises:
        RuntimeError: if the class __init__ has *args in its signature.
      """
      if baseclasses[0] == tf.keras.layers.Layer:
          # This is just Network below.  Return early.
          return abc.ABCMeta.__new__(mcs, classname, baseclasses, attrs)
  
      init = attrs.get("__init__", None)
  
      if not init:
          # This wrapper class does not define an __init__.  When someone creates
          # the object, the __init__ of its parent class will be called.  We will
          # call that __init__ instead separately since the parent class is also a
          # subclass of Network.  Here just create the class and return.
          return abc.ABCMeta.__new__(mcs, classname, baseclasses, attrs)
  
      arg_spec = tf_inspect.getargspec(init)
      if arg_spec.varargs is not None:
          raise RuntimeError(
              "%s.__init__ function accepts *args.  This is not allowed."
              % classname
          )
  
      def _capture_init(self, *args, **kwargs):
          """Captures init args and kwargs and stores them into `_saved_kwargs`."""
          if len(args) > len(arg_spec.args) + 1:
              # Error case: more inputs than args.  Call init so that the appropriate
              # error can be raised to the user.
              init(self, *args, **kwargs)
          # Convert to a canonical kwarg format.
          kwargs = tf_inspect.getcallargs(init, self, *args, **kwargs)
          kwargs.pop("self")
          init(self, **kwargs)
          # Avoid auto tracking which prevents keras from tracking layers that are
          # passed as kwargs to the Network.
          with base.no_automatic_dependency_tracking_scope(self):
              setattr(self, "_saved_kwargs", kwargs)
  
      attrs["__init__"] = tf_decorator.make_decorator(
          init, _capture_init
      )
      return abc.ABCMeta.__new__(mcs, classname, baseclasses, attrs)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import typing
  import six
  import tensorflow
  import tensorflow_probability
  from tf_agents.distributions import utils
  from tf_agents.networks import layer_utils
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import nest_utils
  from tf_agents.utils import object_identity
  from tensorflow.python.trackable import base
  from tensorflow.python.util import tf_decorator
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 1 for calling the _NetworkMeta obj's underlying member method code with example usage: obj.__new__(mcs, classname, baseclasses, attrs) and returns: abc, abc, abc