Merges the policy of another policy into the current policy. Args: other: The policy to merge into this one. Raises: ValueError: If this policy has been frozen and the merge conflicts with the frozen policy.
(self, other)
| 120 | self._shard_dimension = tensor_shape.as_dimension(shard_dimension) |
| 121 | |
| 122 | def merge(self, other): |
| 123 | """Merges the policy of another policy into the current policy. |
| 124 | |
| 125 | Args: |
| 126 | other: The policy to merge into this one. |
| 127 | |
| 128 | Raises: |
| 129 | ValueError: If this policy has been frozen and the merge conflicts with |
| 130 | the frozen policy. |
| 131 | """ |
| 132 | if other.number_of_shards is not None: |
| 133 | self.set_number_of_shards(other.number_of_shards) |
| 134 | if other.shard_dimension is not None: |
| 135 | self.set_shard_dimension(other.shard_dimension) |
| 136 | |
| 137 | def get_sharded_shape(self, shape, shard_index=None): |
| 138 | """Returns the shape of a shard of a full Tensor. |