code: def test_softmax_y_shape_assert(
      num: int, dimX: int, dimF: int, dimY: int
  ) -> None:
      """
      SoftMax assumes the class is given as a label (not, e.g., one-hot
      encoded), and hence just uses the first column of Y. To prevent
      silent errors, there is a tf assertion that ensures Y only has one
      dimension. This test checks that this assert works as intended.
      """
      X = tf.random.normal((num, dimX))
      F = tf.random.normal((num, dimF))
      dY: AnyNDArray = (
          np.vstack(
              (np.random.randn(num - 3, dimY), np.ones((3, dimY)))
          )
          > 0
      )
      Y = tf.convert_to_tensor(dY, dtype=default_int())
      likelihood = Softmax(dimF)
      try:
          likelihood.log_prob(X, F, Y)
      except tf.errors.InvalidArgumentError as e:
          assert "Condition x == y did not hold." in e.message
  
file_path: GPflow/tests/gpflow/likelihoods/test_multiclass.py
imports: import numpy
  import pytest
  import tensorflow
  from check_shapes import inherit_check_shapes
  from numpy.testing import assert_allclose
  from gpflow.base import AnyNDArray, TensorType
  from gpflow.config import default_float, default_int
  from gpflow.likelihoods import Bernoulli, MultiClass, RobustMax, Softmax
  from gpflow.utilities import to_default_float, to_default_int
label_desc: Use image node_id 1 for calling a global function with example usage: test_softmax_y_shape_assert(num, dimX, dimF, dimY) without return types