Skip to content

Commit bb997e0

Browse files
gnsinfiWang
authored andcommitted
Add missing llvm:: namespace qualifiers for DTensor
Add the `llvm::` namespace prefix to `cast` and `isa` where it was missing in the DTensor MLIR code.
1 parent 180404a commit bb997e0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tensorflow/dtensor/mlir/shape_utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ StatusOr<llvm::ArrayRef<int64_t>> ExtractGlobalInputShape(
7373
return errors::Internal("global_shape does not have static rank");
7474
return *global_shape;
7575
}
76-
return ExtractGlobalOutputShape(cast<mlir::OpResult>(input_value.get()));
76+
return ExtractGlobalOutputShape(llvm::cast<mlir::OpResult>(input_value.get()));
7777
}
7878

7979
// If we reach this point, we're working with a function argument.

tensorflow/dtensor/mlir/spmd_expansion.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ bool GetResourceArgIndexIfUsedInAssignmentOp(
188188
GetForwardedDTensorLayoutInput(assign_variable_op.getResource());
189189
if (llvm::isa<mlir::BlockArgument>(resource)) {
190190
*resource_argument_index_for_assign_variable =
191-
cast<mlir::BlockArgument>(resource).getArgNumber();
191+
llvm::cast<mlir::BlockArgument>(resource).getArgNumber();
192192
return true;
193193
}
194194
}
@@ -221,7 +221,7 @@ mlir::LogicalResult UpdateFunctionArgsUsingLayout(mlir::func::FuncOp function) {
221221

222222
// If argument is a resource type update the subtype shape information
223223
// to reflect local shape of resources.
224-
if (isa<mlir::TF::ResourceType>(arg_type)) {
224+
if (llvm::isa<mlir::TF::ResourceType>(arg_type)) {
225225
if (mlir::failed(UpdateResourceArgumentType(argument_index, function)))
226226
return mlir::failure();
227227
continue;

0 commit comments

Comments
 (0)