docstr: Tests that an error is raised if dataset materialization is wrong.
docstr_tok: ["Tests","that","an","error","is","raised","if","dataset","materialization","is","wrong","."]
code: def testBadMaterialization(self):
      """Tests that an error is raised if dataset materialization is wrong."""
      dataset = np.zeros(5)
      with self.assertRaisesRegexp(
          AssertionError, "Erroneously materialized dataset"
      ):
          self.validate_deferred_materialization(
              functools.partial(
                  TestModelWithDataset, materialize_dataset=True
              ),
              dataset=dataset,
          )
  
imports: import atexit
  import functools
  from absl import logging
  import jax
  import numpy
  import tensorflow.compat.v2
  import tensorflow.compat.v2
  import tensorflow_probability
  from tensorflow_probability.python.internal import test_util
  from inference_gym import targets
  from inference_gym.internal import test_util
label_desc: Use image node_id 11 for calling the InferenceGymTestCaseTest obj's underlying member method code with example usage: obj.testBadMaterialization() without return types