| 594 | } |
| 595 | |
| 596 | static void SliceTensor(DenseTensor *x, |
| 597 | const DenseTensor *share, |
| 598 | const std::vector<int64_t> &out_compute_dims, |
| 599 | int64_t offset) { |
| 600 | auto new_dim = make_ddim(out_compute_dims); |
| 601 | DenseTensorMeta meta(share->dtype(), |
| 602 | new_dim, |
| 603 | share->layout(), |
| 604 | offset * SizeOf(share->dtype()) + share->offset()); |
| 605 | x->set_meta(meta); |
| 606 | x->ShareBufferWith(*(share), true); |
| 607 | x->Resize(new_dim); |
| 608 | } |
| 609 | |
| 610 | template <typename OutT, typename Functor, int kArity, int NumOuts = 1> |
| 611 | void BroadcastKernelSplit(const KPDevice &dev_ctx, |
no test coverage detected