class_docstr: A DDPG Agent.
code: def _apply_gradients(self, gradients, variables, optimizer):
      if optimizer is None:
          raise ValueError("Optimizer is undefined.")
      # Tuple is used for py3, where zip is a generator producing values once.
      grads_and_vars = tuple(zip(gradients, variables))
      if self._gradient_clipping is not None:
          grads_and_vars = eager_utils.clip_gradient_norms(
              grads_and_vars, self._gradient_clipping
          )
  
      if self._summarize_grads_and_vars:
          eager_utils.add_variables_summaries(
              grads_and_vars, self.train_step_counter
          )
          eager_utils.add_gradients_summaries(
              grads_and_vars, self.train_step_counter
          )
  
      optimizer.apply_gradients(grads_and_vars)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import Optional, Text
  import gin
  import tensorflow
  from tf_agents.agents import data_converter
  from tf_agents.agents import tf_agent
  from tf_agents.networks import network
  from tf_agents.policies import actor_policy
  from tf_agents.policies import ou_noise_policy
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import eager_utils
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 6 for calling the DdpgAgent obj's underlying member method code with example usage: obj._apply_gradients(gradients, variables, optimizer) without return types