class_docstr: Tests for detr model.py.
class_docstr_tok: ["Tests","for","detr","model.py","."]
docstr: Tests InputPosEmbeddingSine.
docstr_tok: ["Tests","InputPosEmbeddingSine","."]
code: def test_input_pos_embedding_sine(self):
      """Tests InputPosEmbeddingSine."""
      rng = random.PRNGKey(0)
      b, h, w, hidden = (8, 32, 19, 64)
      padding_mask = np.zeros((b, h, w))
      padding_mask[:, 16:, :] = 0
      padding_mask[:, :, 16:] = 0
  
      positional_embedding_def = model.InputPosEmbeddingSine(
          hidden_dim=hidden
      )
      pos, _ = positional_embedding_def.init_with_output(
          rng, padding_mask
      )
      # test output shape
      self.assertEqual(pos.shape, (b, h * w, hidden))
  
imports: import functools
  from absl.testing import absltest
  from absl.testing import parameterized
  from flax import jax_utils
  from flax import traverse_util
  from flax.core import unfreeze
  import jax
  from jax import random
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.projects.baselines.detr import model
label_desc: Use image node_id 2 for calling the DETRModulesTest obj's underlying member method code with example usage: obj.test_input_pos_embedding_sine() without return types