class_docstr: Tests for utilities in nn_ops.py.
class_docstr_tok: ["Tests","for","utilities","in","nn_ops.py","."]
code: def test_compute_1d_relative_distance_min_and_max(self):
      len_q = np.random.randint(0, 100, (1,))
      len_k = np.random.randint(0, 100, (1,))
      relative_distance = nn_ops.compute_1d_relative_distance(
          len_q, len_k
      )
      self.assertEqual(relative_distance.min(), 0)
      self.assertEqual(relative_distance.max(), len_q + len_k - 2)
  
imports: import functools
  from absl.testing import absltest
  from absl.testing import parameterized
  import flax.linen
  import jax
  import jax.numpy
  import numpy
  from scenic.model_lib.layers import nn_ops
label_desc: Use image node_id 11 for calling the NNOpsTest obj's underlying member method code with example usage: obj.test_compute_1d_relative_distance_min_and_max() without return types