| 708 | } |
| 709 | |
| 710 | StatusOr<std::unique_ptr<PyLocalBuffer>> PyLocalExecutable::Execute( |
| 711 | absl::Span<PyLocalBuffer* const> argument_handles) { |
| 712 | if (num_replicas() != 1) { |
| 713 | return InvalidArgument( |
| 714 | "Attempted to execute computation with %d replicas using Execute()", |
| 715 | num_replicas()); |
| 716 | } |
| 717 | if (num_partitions() != 1) { |
| 718 | return InvalidArgument( |
| 719 | "Attempted to execute computation with %d partitions using Execute()", |
| 720 | num_partitions()); |
| 721 | } |
| 722 | VLOG(1) << "Executing computation " << name(); |
| 723 | return ExecuteHelper(argument_handles, /*replica=*/0, /*partition=*/0, |
| 724 | RunId()); |
| 725 | } |
| 726 | |
| 727 | StatusOr<std::vector<std::unique_ptr<PyLocalBuffer>>> |
| 728 | PyLocalExecutable::ExecutePerReplica( |