(tensor, is_parallel, dim, stride)
| 53 | |
| 54 | |
| 55 | def set_tensor_model_parallel_attributes(tensor, is_parallel, dim, stride): |
| 56 | # Make sure the attributes are not set. |
| 57 | for attribute in _MODEL_PARALLEL_ATTRIBUTE_DEFAULTS: |
| 58 | assert not hasattr(tensor, attribute) |
| 59 | # Set the attributes. |
| 60 | setattr(tensor, "tensor_model_parallel", is_parallel) |
| 61 | setattr(tensor, "partition_dim", dim) |
| 62 | setattr(tensor, "partition_stride", stride) |
| 63 | |
| 64 | |
| 65 | def set_defaults_if_not_set_tensor_model_parallel_attributes(tensor): |
no outgoing calls
no test coverage detected