| 231 | explicit TensorWrapper(std::shared_ptr<Tensor<Backend>> t) : t_(std::move(t)) {} |
| 232 | |
| 233 | void Resize( |
| 234 | int ndim, |
| 235 | const int64_t *shape, |
| 236 | daliDataType_t dtype, |
| 237 | const char *layout) override { |
| 238 | ValidateShape(ndim, shape); |
| 239 | Validate(dtype); |
| 240 | if (layout) |
| 241 | Validate(TensorLayout(layout), ndim); |
| 242 | t_->Resize(TensorShape<>(make_cspan(shape, ndim)), dtype); |
| 243 | if (layout) |
| 244 | t_->SetLayout(layout); |
| 245 | } |
| 246 | |
| 247 | void AttachBuffer( |
| 248 | int ndim, |