class_docstr: Structure containing the networks for D4PG.
docstr: Initialize the networks given an environment spec.
code: def init(self, environment_spec: specs.EnvironmentSpec):
      """Initialize the networks given an environment spec."""
      # Get observation and action specs.
      act_spec = environment_spec.actions
      obs_spec = environment_spec.observations
  
      # Create variables for the observation net and, as a side-effect, get a
      # spec describing the embedding space.
      emb_spec = utils.create_variables(
          self.observation_network, [obs_spec]
      )
  
      # Create variables for the policy and critic nets.
      _ = utils.create_variables(self.policy_network, [emb_spec])
      _ = utils.create_variables(
          self.critic_network, [emb_spec, act_spec]
      )
  
imports: import copy
  import dataclasses
  import functools
  from typing import Iterator, List, Optional, Tuple, Union, Sequence
  from acme import adders
  from acme import core
  from acme import datasets
  from acme import specs
  from acme import types
  from acme.adders import reverb
  from acme.agents import agent
  from acme.agents.tf import actors
  from acme.agents.tf.d4pg import learning
  from acme.tf import networks
  from acme.tf import utils
  from acme.tf import variable_utils
  from acme.utils import counting
  from acme.utils import loggers
  import reverb
  import sonnet
  import tensorflow
label_desc: Use image node_id 2 for calling the D4PGNetworks obj's underlying member method code with example usage: obj.init(environment_spec) without return types