class_docstr: Unit tests for detr test_input_pipeline_detection.py.
docstr: Tests data type of dataset coco_deformable_detr_detection.
code: def test_dtypes_input_pipeline_detection(self):
      """Tests data type of dataset coco_deformable_detr_detection."""
  
      with tfds.testing.mock_data(
          num_examples=50,
          as_dataset_fn=test_util.generate_fake_dataset(
              num_examples=50
          ),
      ):
          num_shards = jax.local_device_count()
          for dt in ["float32"]:
              dataset = input_pipeline_detection.get_dataset(
                  batch_size=num_shards * 2,
                  eval_batch_size=num_shards * 2,
                  num_shards=num_shards,
                  dtype_str=dt,
              )
  
              train_batch = next(dataset.train_iter)
              eval_batch = next(dataset.valid_iter)
  
              # Check dtype.
              self.assertEqual(
                  train_batch["inputs"].dtype, getattr(jnp, dt)
              )
              self.assertEqual(
                  eval_batch["inputs"].dtype, getattr(jnp, dt)
              )
  
file_path: scenic/scenic/projects/baselines/deformable_detr/tests/test_input_pipeline.py
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import jax
  import jax.numpy
  import ml_collections
  from scenic.projects.baselines.deformable_detr import input_pipeline_detection
  from scenic.projects.baselines.detr.tests import test_util
  import tensorflow_datasets
label_desc: Use image node_id 2 for calling the DeformableDETRInputPipelineTests obj's underlying member method code with example usage: obj.test_dtypes_input_pipeline_detection() without return types