Log error before failing
Report the error before crashing. It is unfortunate that the internal helper function can be used safely, while the external accessor cannot. But this avoids at least dropping the error message. PiperOrigin-RevId: 351272683 Change-Id: I34ceda0b59b61aec6351c5efc8cb34e1e7291a9f
This commit is contained in:
parent
68024de2a7
commit
b30f3f3a36
@ -309,9 +309,11 @@ StatusOr<Shape> MakeShapeWithLayoutInternal(
|
||||
PrimitiveType element_type, absl::Span<const int64> dimensions,
|
||||
absl::Span<const int64> minor_to_major, absl::Span<const Tile> tiles,
|
||||
int64 element_size_in_bits, int64 memory_space) {
|
||||
return MakeShapeWithLayoutInternal(element_type, dimensions, minor_to_major,
|
||||
tiles, element_size_in_bits, memory_space)
|
||||
.ValueOrDie();
|
||||
auto ret =
|
||||
MakeShapeWithLayoutInternal(element_type, dimensions, minor_to_major,
|
||||
tiles, element_size_in_bits, memory_space);
|
||||
if (!ret.ok()) LOG(ERROR) << ret.status();
|
||||
return ret.ValueOrDie();
|
||||
}
|
||||
|
||||
/* static */ Shape ShapeUtil::MakeShapeWithDescendingLayout(
|
||||
|
Loading…
x
Reference in New Issue
Block a user