| 293 | } |
| 294 | |
| 295 | Status HloSharding::Validate(const Shape& shape, int64 num_devices) const { |
| 296 | Status status = IsTuple() ? ValidateTuple(shape, num_devices) |
| 297 | : ValidateNonTuple(shape, num_devices); |
| 298 | if (!status.ok()) { |
| 299 | tensorflow::errors::AppendToMessage( |
| 300 | &status, StrCat("Note: While validating sharding ", ToString(), |
| 301 | " against shape ", ShapeUtil::HumanString(shape))); |
| 302 | } |
| 303 | return status; |
| 304 | } |
| 305 | |
| 306 | Status HloSharding::ValidateNonTuple(const Shape& shape, |
| 307 | int64 num_devices) const { |