| 28 | namespace MNN { |
| 29 | |
| 30 | void BlstmComputer::trimTensor(Tensor *src_tensor, Tensor *tgt_tensor) { |
| 31 | MNN_ASSERT(src_tensor->shape() == tgt_tensor->shape()); |
| 32 | auto src_format = TensorUtils::getDescribe(src_tensor)->dimensionFormat; |
| 33 | if (src_format == MNN_DATA_FORMAT_NCHW || |
| 34 | src_format == MNN_DATA_FORMAT_NHWC) { |
| 35 | memcpy(tgt_tensor->host<float>(), src_tensor->host<float>(), |
| 36 | size_t(src_tensor->size())); |
| 37 | } else if (src_format == MNN_DATA_FORMAT_NC4HW4) { |
| 38 | mBackend->onCopyBuffer(src_tensor, tgt_tensor); |
| 39 | } else { |
| 40 | MNN_ERROR("src_tensor format not supported\n"); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | BlstmComputer::~BlstmComputer() { |
| 45 | for (int i = 0; i < mWeights.size(); i++) { |
nothing calls this directly
no test coverage detected