def METHOD_NAME(action_spec, observation_spec):
  """Validates the spec contains a single action."""
  del observation_spec  # not currently validated
  flat_action_spec = tf.nest.flatten(action_spec)
  if len(flat_action_spec) > 1:
    raise ValueError('Network only supports action_specs with a single action.')
  if flat_action_spec[0].shape not in [(), (1,)]:
    raise ValueError(
        'Network only supports action_specs with shape in [(), (1,)])'
    )