tensorflow/compiler/mlir/tensorflow/transforms/tpu_sharding_identification_pass.cc
// Returns XLA sharding from TPUPartitionedInput op connected to a
// `tf_device.cluster_func` operand value. If value is a resource type then
// TPUPartitionedInput op will be connected to a ReadVariable op that feeds into
// a `tf_device.cluster_func`.
Returns XLA sharding from TPUPartitionedInput op connected to a
`tf_device.cluster_func` operand value. If value is a resource type then
TPUPartitionedInput op will be connected to a ReadVariable op that feeds into
a `tf_device.cluster_func`.
Returns XLA sharding from TPUPartitionedInput op connected to a ` tf_device . cluster_func ` operand value . If value is a resource type then TPUPartitionedInput op will be connected to a ReadVariable op that feeds into a ` tf_device . cluster_func ` .
llvm::Optional<llvm::StringRef> GetXlaShardingFromOperand(Value value) {
  Value value_to_visit = value;
  if (auto read_var = value_to_visit.getDefiningOp<TF::ReadVariableOp>())
    value_to_visit = read_var.resource();
  if (auto partitioned_input =
          value_to_visit.getDefiningOp<TF::TPUPartitionedInputOp>())
    return partitioned_input._XlaSharding();
  return llvm::None;
}
llvm :: Optional < llvm :: StringRef > GetXlaShardingFromOperand ( Value value ) { Value value_to_visit = value ; if ( auto read_var = value_to_visit . getDefiningOp < TF :: ReadVariableOp > ( ) ) value_to_visit = read_var . resource ( ) ; if ( auto partitioned_input = value_to_visit . getDefiningOp < TF :: TPUPartitionedInputOp > ( ) ) return partitioned_input . _XlaSharding ( ) ; return llvm :: None ; }
Returns XLA sharding from TPUPartitionedInput op connected to a
`tf_device.cluster_func` operand value.
Returns XLA sharding from TPUPartitionedInput op connected to a ` tf_device . cluster_func ` operand value .