(name1: str, tensor1: TensorLike, name2: str, tensor2: TensorLike)
| 165 | raise NotImplementedError(f'Cannot write floats to {__describe(tensor)}') |
| 166 | |
| 167 | def __expect_same_layout(name1: str, tensor1: TensorLike, name2: str, tensor2: TensorLike): |
| 168 | shape1, shape2 = __get_shape(tensor1), __get_shape(tensor2) |
| 169 | assert shape1 == shape2, f"Shape mismatch: {name1} has {shape1} but {name2} has {shape2}" |
| 170 | assert __is_contiguous(tensor1) and __is_contiguous(tensor2), f"Only contiguous tensors are supported (got {name1} with strides {__get_strides(tensor1)} and {name2} with strides {__get_strides(tensor2)})" |
| 171 | |
| 172 | def __check_shape_consistent_with_type(tensor: TensorLike): |
| 173 | type = __get_type(tensor) |
no test coverage detected