| 80 | } |
| 81 | |
| 82 | Maybe<Tensor> BasicView(const std::shared_ptr<Tensor>& input, const Shape& target_shape, |
| 83 | const int64_t storage_offset) { |
| 84 | /** |
| 85 | * This function provides basic view capabilities which |
| 86 | * accept input tensor with target shape, and return viewed tensor. |
| 87 | * |
| 88 | * The viewed tensor shared memory with input tensor, and both of |
| 89 | * them are memory contiguous, but has different shapes/strides. |
| 90 | */ |
| 91 | Stride target_stride(target_shape); |
| 92 | return BasicView(input, target_shape, target_stride, storage_offset); |
| 93 | } |
| 94 | |
| 95 | Maybe<Tensor> BasicView(const std::shared_ptr<Tensor>& input, const Shape& target_shape, |
| 96 | const Stride& target_stride, const int64_t storage_offset) { |
no test coverage detected