Send the partitioned data shape back to client. Parameters ---------- shape : tuple shape of tensor
| 444 | |
| 445 | |
| 446 | class GetPartShapeResponse(rpc.Response): |
| 447 | """Send the partitioned data shape back to client. |
| 448 | |
| 449 | Parameters |
| 450 | ---------- |
| 451 | shape : tuple |
| 452 | shape of tensor |
| 453 | """ |
| 454 | |
| 455 | def __init__(self, shape): |
| 456 | self.shape = shape |
| 457 | |
| 458 | def __getstate__(self): |
| 459 | return self.shape |
| 460 | |
| 461 | def __setstate__(self, state): |
| 462 | # When the shape has only one dimension, state is an integer. |
| 463 | if isinstance(state, int): |
| 464 | self.shape = (state,) |
| 465 | else: |
| 466 | self.shape = state |
| 467 | |
| 468 | |
| 469 | class GetPartShapeRequest(rpc.Request): |