docstr: Tests consistency between multi-axis and single-axis l2_project.
  
  This calls l2_project on multi-axis supports, and checks that it gets
  the same outcomes as many calls to single-axis supports.
  
  Args:
    src_shape: Shape of source support. Includes a leading batch axis.
    dst_shape: Shape of destination support.
      Does not include a leading batch axis.
docstr_tok: ["Tests","consistency","between","multi-axis","and","single-axis","l2_project",".","This","calls","l2_project","on","multi-axis","supports",",","and","checks","that","it","gets","the","same","outcomes","as","many","calls","to","single-axis","supports",".","Args",":","src_shape",":","Shape","of","source","support",".","Includes","a","leading","batch","axis",".","dst_shape",":","Shape","of","destination","support",".","Does","not","include","a","leading","batch","axis","."]
code: def test_multiaxis(self, src_shape, dst_shape):
      """Tests consistency between multi-axis and single-axis l2_project.
  
      This calls l2_project on multi-axis supports, and checks that it gets
      the same outcomes as many calls to single-axis supports.
  
      Args:
        src_shape: Shape of source support. Includes a leading batch axis.
        dst_shape: Shape of destination support.
          Does not include a leading batch axis.
      """
      # src_shape includes a leading batch axis, whereas dst_shape does not.
      # assert len(src_shape) >= (1 + len(dst_shape))
  
      def make_support(shape, minimum):
          """Creates a ndarray of supports."""
          values = np.linspace(
              start=minimum, stop=minimum + 100, num=shape[-1]
          )
          offsets = np.arange(np.prod(shape[:-1]))
          result = values[None, :] + offsets[:, None]
          return result.reshape(shape)
  
      src_support = make_support(src_shape, -1)
      dst_support = make_support(dst_shape, -0.75)
  
      rng = np.random.RandomState(1)
      src_probs = rng.uniform(low=1.0, high=2.0, size=src_shape)
      src_probs /= src_probs.sum()
  
      # Repeated calls to l2_project using single-axis supports.
      expected_dst_probs = _reference_l2_project(
          src_support, src_probs, dst_support
      )
  
      # A single call to l2_project, with multi-axis supports.
      dst_probs = distributional.multiaxis_l2_project(
          tf.convert_to_tensor(src_support),
          tf.convert_to_tensor(src_probs),
          tf.convert_to_tensor(dst_support),
      ).numpy()
  
      npt.assert_allclose(dst_probs, expected_dst_probs)
  
file_path: acme/acme/tf/losses/distributional_test.py
imports: from acme.tf.losses import distributional
  import numpy
  from numpy import testing
  import tensorflow
  from absl.testing import absltest
  from absl.testing import parameterized
label_desc: Use image node_id 1 for calling the L2ProjectTest obj's underlying member method code with example usage: obj.test_multiaxis(src_shape, dst_shape) and returns: result