| 9 | |
| 10 | template <typename T> |
| 11 | void RepeatForwardImpl::exec_internal( |
| 12 | _megdnn_tensor_in src, _megdnn_tensor_out dst, |
| 13 | _megdnn_workspace /* workspace */) { |
| 14 | auto ndim = src.layout.ndim; |
| 15 | auto sptr = src.ptr<T>(), dptr = dst.ptr<T>(); |
| 16 | auto sshape = src.layout.shape, dshape = dst.layout.shape; |
| 17 | auto tshape = param().times.shape; |
| 18 | size_t didx[TensorShape::MAX_NDIM]; |
| 19 | std::memset(didx, 0, sizeof(didx)); |
| 20 | do { |
| 21 | size_t sidx[TensorShape::MAX_NDIM]; |
| 22 | rep(i, ndim) sidx[i] = didx[i] / tshape[i]; |
| 23 | auto si = get_linear_addr(sidx, sshape, ndim); |
| 24 | auto di = get_linear_addr(didx, dshape, ndim); |
| 25 | dptr[di] = sptr[si]; |
| 26 | } while (get_next_addr(didx, dshape, ndim)); |
| 27 | } |
| 28 | |
| 29 | void RepeatForwardImpl::exec( |
| 30 | _megdnn_tensor_in src, _megdnn_tensor_out dst, _megdnn_workspace workspace) { |
nothing calls this directly
no test coverage detected