def _is_at_materialization_boundary(pcollection):
  """Determines whether a PCollection is at a materialization boundary."""
  # Ascend the hierarchy of composite PTransforms. In the Beam pipeline
  # graph, each AppliedPTransform has its "composite parent" stored in its
  # .parent field. Here, we check to see whether, at any of the composite
  # levels, the transform is a materialization boundary.
  current = pcollection.producer
  while current:
    if (current.transform and
        current.transform.__class__ in _MATERIALIZATION_BARRIER_TRANSFORMS):
      return True
    if pcollection in current.parent.outputs.values():
      current = current.parent
    else:
      break
  return False
Determines whether a PCollection is at a materialization boundary.
tensorflow_transform/beam/deep_copy.py