class_docstr: A dataset that stops iteration when `predicate` returns false.
class_docstr_tok: ["A","dataset","that","stops","iteration","when","`","predicate","`","returns","false","."]
docstr: See `take_while()` for details.
docstr_tok: ["See","`","take_while","(",")","`","for","details","."]
code: def __init__(self, input_dataset, predicate, name=None):
      """See `take_while()` for details."""
  
      self._input_dataset = input_dataset
      wrapped_func = structured_function.StructuredFunctionWrapper(
          predicate,
          self._transformation_name(),
          dataset=self._input_dataset,
      )
  
      if not wrapped_func.output_structure.is_compatible_with(
          tensor_spec.TensorSpec([], dtypes.bool)
      ):
          raise ValueError(
              f"Invalid `predicate`. `predicate` must return a "
              f"`tf.bool` scalar tensor but its return type is"
              f"{wrapped_func.output_structure}."
          )
  
      self._predicate = wrapped_func
      self._name = name
      variant_tensor = ged_ops.take_while_dataset(
          self._input_dataset._variant_tensor,  # pylint: disable=protected-access
          other_arguments=self._predicate.function.captured_inputs,
          predicate=self._predicate.function,
          **self._common_args,
      )
      super().__init__(input_dataset, variant_tensor)
  
file_path: tensorflow-upstream/tensorflow/python/data/ops/take_while_op.py
imports: from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import structured_function
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.ops import gen_experimental_dataset_ops
label_desc: Use image node_id 1 to create a new _TakeWhileDataset object from inherited base classes: dataset_ops with example: obj = _TakeWhileDataset(input_dataset, predicate, name)