class_docstr: A `Dataset` that assert the cardinality of its input.
class_docstr_tok: ["A","`","Dataset","`","that","assert","the","cardinality","of","its","input","."]
code: def __init__(self, input_dataset, expected_cardinality):
      self._input_dataset = input_dataset
      self._expected_cardinality = ops.convert_to_tensor(
          expected_cardinality,
          dtype=dtypes.int64,
          name="expected_cardinality",
      )
  
      # pylint: enable=protected-access
      variant_tensor = ged_ops.assert_cardinality_dataset(
          self._input_dataset._variant_tensor,  # pylint: disable=protected-access
          self._expected_cardinality,
          **self._flat_structure,
      )
      super(_AssertCardinalityDataset, self).__init__(
          input_dataset, variant_tensor
      )
  
file_path: tensorflow-upstream/tensorflow/python/data/experimental/ops/cardinality.py
imports: from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import gen_dataset_ops
  from tensorflow.python.ops import gen_experimental_dataset_ops
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 1 to create a new _AssertCardinalityDataset object from inherited base classes: dataset_ops with example: obj = _AssertCardinalityDataset(input_dataset, expected_cardinality)