Added error message for unsupported uninitialized resource variables
Previously, we ran into a generic error message when encountering unsupported uninitialized resource variables so it wasn't clear what the actual problem was. PiperOrigin-RevId: 349483176 Change-Id: Id3819e7c7802d2b2decdd63c8292de88fadcd0ae
This commit is contained in:
parent
8ea9e8cfab
commit
919c8f2738
@ -529,6 +529,12 @@ static StatusOr<std::vector<int>> RewriteWithArgs(
|
|||||||
mlir::BlockArgument mlir_arg = main_fn.getArgument(idx);
|
mlir::BlockArgument mlir_arg = main_fn.getArgument(idx);
|
||||||
if (xla_arg.kind == XlaArgument::kResource) {
|
if (xla_arg.kind == XlaArgument::kResource) {
|
||||||
mlir::Type element_type;
|
mlir::Type element_type;
|
||||||
|
if (xla_arg.type == DT_INVALID) {
|
||||||
|
return errors::Unimplemented(absl::StrCat(
|
||||||
|
"Argument ", idx,
|
||||||
|
" is an uninitialized resource variable which is currently"
|
||||||
|
" unsupported in the MLIR-based TPU bridge"));
|
||||||
|
}
|
||||||
TF_RETURN_IF_ERROR(ConvertDataType(xla_arg.type, builder, &element_type));
|
TF_RETURN_IF_ERROR(ConvertDataType(xla_arg.type, builder, &element_type));
|
||||||
TF_ASSIGN_OR_RETURN(TensorShape arg_shape,
|
TF_ASSIGN_OR_RETURN(TensorShape arg_shape,
|
||||||
GetTensorShapeFromXlaArgument(xla_arg));
|
GetTensorShapeFromXlaArgument(xla_arg));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user