tensorflow/compiler/mlir/tensorflow/transforms/tpu_space_to_depth_pass.cc
// Checks if the input producer op is supported in this transform. Right now, we
// only check if it is a host tf.IteratorGetNext.
Checks if the input producer op is supported in this transform. Right now, we
only check if it is a host tf.IteratorGetNext.
Checks if the input producer op is supported in this transform . Right now we only check if it is a host tf . IteratorGetNext .
bool IsSupportedHostInputOp(Operation* op) {
  TF::IteratorGetNextOp iter = llvm::dyn_cast<TF::IteratorGetNextOp>(op);
  if (!iter) return false;
  auto device = op->getAttrOfType<StringAttr>(kDeviceAttr);
  if (!device) return false;
  tensorflow::DeviceNameUtils::ParsedName parsed_device;
  if (!tensorflow::DeviceNameUtils::ParseFullName(device.getValue().str(),
                                                  &parsed_device)) {
    return false;
  }
  return parsed_device.type == "CPU";
}
bool IsSupportedHostInputOp ( Operation * op ) { TF :: IteratorGetNextOp iter = llvm :: dyn_cast < TF :: IteratorGetNextOp > ( op ) ; if ( ! iter ) return false ; auto device = op -> getAttrOfType < StringAttr > ( kDeviceAttr ) ; if ( ! device ) return false ; tensorflow :: DeviceNameUtils :: ParsedName parsed_device ; if ( ! tensorflow :: DeviceNameUtils :: ParseFullName ( device . getValue ( ) . str ( ) , & parsed_device ) ) { return false ; } return parsed_device . type == " " ; }
Checks if the input producer op is supported in this transform.
Checks if the input producer op is supported in this transform .