Home
last modified time | relevance | path

Searched refs:src_tensor (Results 1 – 22 of 22) sorted by relevance

/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/base/
Dcarry_data.cc35 auto *src_tensor = *src_iter; in MoveData() local
36 if (dst_tensor == nullptr || src_tensor == nullptr) { in MoveData()
41 if (src_tensor->IsConst() || src_tensor->IsGraphInput()) { in MoveData()
43 dst_tensor->set_data(src_tensor->data()); in MoveData()
46 …if (src_tensor->data_type() == kObjectTypeTensorType && dst_tensor->data_type() == kObjectTypeTens… in MoveData()
50 reinterpret_cast<lite::TensorList *>(src_tensor)); in MoveData()
57 ret = MoveTensorData(dst_tensor, src_tensor); in MoveData()
68 int CarryDataKernel::MoveTensorData(lite::Tensor *dst_tensor, lite::Tensor *src_tensor) { in MoveTensorData() argument
69 …if (dst_tensor->data_type() != src_tensor->data_type() || dst_tensor->format() != src_tensor->form… in MoveTensorData()
70 …!(dst_tensor->shape() == src_tensor->shape() || (dst_tensor->shape().empty() && src_tensor->shape(… in MoveTensorData()
[all …]
Dcarry_data.h39 int MoveTensorData(lite::Tensor *dst_tensor, lite::Tensor *src_tensor);
/third_party/mindspore/mindspore/lite/src/
Dlite_session.cc56 bool NeedBitUppackCheck(const schema::Tensor &src_tensor) { in NeedBitUppackCheck() argument
57 if (src_tensor.enableHuffmanCode()) { in NeedBitUppackCheck()
60 …bool need_bit_unpack = src_tensor.quantParams() != nullptr && src_tensor.quantParams()->size() > 0… in NeedBitUppackCheck()
61 src_tensor.quantParams()->Get(0) != nullptr; in NeedBitUppackCheck()
63 auto num_bits = src_tensor.quantParams()->Get(0)->numBits(); in NeedBitUppackCheck()
70 int DecompressTensor(const schema::Tensor &src_tensor, Tensor *dst_tensor) { in DecompressTensor() argument
73 if (src_tensor.weightQunatCompressType() == schema::WeightQunatCompressType_FSE) { in DecompressTensor()
74 return quant::FSEDecoder::DeCompress(src_tensor, dst_tensor); in DecompressTensor()
75 } else if (src_tensor.weightQunatCompressType() == schema::WeightQunatCompressType_INDEXING) { in DecompressTensor()
76 return IndexingDecompress(src_tensor, dst_tensor); in DecompressTensor()
[all …]
Dweight_decoder.cc35 STATUS IndexingDecompress(const schema::Tensor &src_tensor, Tensor *dst_tensor) { in IndexingDecompress() argument
37 MS_CHECK_TRUE_MSG(src_tensor.quantParams() != nullptr, RET_ERROR, "quant params is nullptr"); in IndexingDecompress()
38 …MS_CHECK_TRUE_MSG((*src_tensor.quantParams()).size() > 0, RET_ERROR, "quant params size need bigge… in IndexingDecompress()
39 …MS_CHECK_TRUE_MSG(src_tensor.quantParams()->Get(0) != nullptr, RET_ERROR, "quant param is nullptr"… in IndexingDecompress()
40 auto bit_num = src_tensor.quantParams()->Get(0)->numBits(); in IndexingDecompress()
42 …std::string str(reinterpret_cast<const char *>(src_tensor.data()->data()), src_tensor.data()->size… in IndexingDecompress()
100 STATUS SparseDecompress(const schema::Tensor &src_tensor, Tensor *dst_tensor) { in SparseDecompress() argument
102 MS_CHECK_TRUE_MSG(src_tensor.quantParams() != nullptr, RET_ERROR, "quant params is nullptr"); in SparseDecompress()
103 …MS_CHECK_TRUE_MSG((*src_tensor.quantParams()).size() > 0, RET_ERROR, "quant params size need bigge… in SparseDecompress()
104 …MS_CHECK_TRUE_MSG(src_tensor.quantParams()->Get(0) != nullptr, RET_ERROR, "quant param is nullptr"… in SparseDecompress()
[all …]
Dlite_mindrt.cc180 auto src_tensor = map.second; in ResizeGraphInput() local
182 if (src_tensor == inputs[i]) { in ResizeGraphInput()
285 void LiteOpActor::MoveTensorInputData(Tensor *dst_tensor, Tensor *src_tensor) { in MoveTensorInputData() argument
286 MS_ASSERT(src_tensor != dst_tensor); in MoveTensorInputData()
289 dst_tensor->set_allocator(src_tensor->allocator()); in MoveTensorInputData()
291 src_tensor->allocator()->IncRefCount(src_tensor->data(), dst_tensor->ref_count()); in MoveTensorInputData()
293 if (src_tensor->data() != nullptr) { in MoveTensorInputData()
294 dst_tensor->set_data(src_tensor->MutableData()); /* using MutableData to sync GPU data */ in MoveTensorInputData()
297 dst_tensor->set_own_data(src_tensor->own_data()); in MoveTensorInputData()
298 src_tensor->DecRefCount(); in MoveTensorInputData()
[all …]
Dmindrt_executor.cc136 auto src_tensor = tensor_map.first; in TransferGraphOutput() local
137 dst_tensor->set_shape(src_tensor->shape()); in TransferGraphOutput()
140 if (src_tensor->data_type() == kNumberTypeFloat16) { in TransferGraphOutput()
142 Fp16ToFloat32(reinterpret_cast<uint16_t *>(src_tensor->MutableData()), in TransferGraphOutput()
145 dst_tensor->set_data(src_tensor->data()); in TransferGraphOutput()
146 src_tensor->set_data(nullptr); in TransferGraphOutput()
148 src_tensor->DecRefCount(); in TransferGraphOutput()
155 auto src_tensor = tensor_map.first; in FreeOutputTensor() local
160 if (dst_tensor->data_type() == src_tensor->data_type()) { in FreeOutputTensor()
162 src_tensor->set_data(dst_tensor->data()); in FreeOutputTensor()
[all …]
Dtensor.cc33 int Tensor::CopyTensorData(const Tensor &src_tensor, Tensor *dst_tensor) { in CopyTensorData() argument
38 if (src_tensor.data_ == nullptr) { in CopyTensorData()
43 if (data_size != src_tensor.Size()) { in CopyTensorData()
52 memcpy(dst_tensor->data_, src_tensor.data_, data_size); in CopyTensorData()
56 Tensor *Tensor::CopyTensor(const Tensor &src_tensor, bool copy_data, AllocatorPtr allocator) { in CopyTensor() argument
62 result->data_type_ = src_tensor.data_type_; in CopyTensor()
63 result->shape_ = src_tensor.shape_; in CopyTensor()
64 result->category_ = src_tensor.category_; in CopyTensor()
65 result->format_ = src_tensor.format_; in CopyTensor()
67 result->set_tensor_name(src_tensor.tensor_name() + "_duplicate"); in CopyTensor()
[all …]
Dlite_mindrt.h101 void MoveTensorInputData(Tensor *dst_tensor, Tensor *src_tensor);
102 void MoveInputData(Tensor *dst_tensor, Tensor *src_tensor);
103 void SetInputData(Tensor *dst_tensor, Tensor *src_tensor);
104 int CastInputData(Tensor *dst_tensor, Tensor *src_tensor);
105 bool NeedCastData(Tensor *dst_tensor, Tensor *src_tensor);
106 int CastTensorInputData(Tensor *dst_tensor, Tensor *src_tensor);
108 void MoveTensorListInputData(TensorList *dst_tensor, TensorList *src_tensor);
109 int CastTensorListInputData(TensorList *dst_tensor, TensorList *src_tensor);
Dtensorlist.cc174 int TensorList::SetTensor(int index, const Tensor *src_tensor) { in SetTensor() argument
175 MS_CHECK_TRUE_MSG(src_tensor != nullptr, RET_ERROR, "src tensor cannot null"); in SetTensor()
177 if (src_tensor->data_type() != this->tensors_data_type_) { in SetTensor()
178 MS_LOG(ERROR) << "src_tensor->data_type():" << src_tensor->data_type() in SetTensor()
189 this->tensors_[index] = Tensor::CopyTensor(*src_tensor); in SetTensor()
Dweight_decoder.h125 STATUS SparseDecompress(const schema::Tensor &src_tensor, Tensor *dst_tensor);
127 STATUS IndexingDecompress(const schema::Tensor &src_tensor, Tensor *dst_tensor);
133 static int UnPack(const schema::Tensor &src_tensor, lite::Tensor *dst_tensor);
138 static int UnPackToInt(const schema::Tensor &src_tensor, lite::Tensor *dst_tensor);
140 static int DecodeHuffmanCode(const schema::Tensor &src_tensor, lite::Tensor *dst_tensor);
Dlite_session.h91 static void ConvertTensorsQuantParam(const schema::Tensor *src_tensor, lite::Tensor *dst_tensor);
93 …ConvertTensorsData(const lite::Model *model, size_t tensor_index, const schema::Tensor *src_tensor,
96 lite::Tensor *ConvertTensor(const schema::Tensor &src_tensor);
Dscheduler.cc637 void CopyCommonTensor(Tensor *dst_tensor, Tensor *src_tensor) { in CopyCommonTensor() argument
638 dst_tensor->set_data_type(src_tensor->data_type()); in CopyCommonTensor()
639 dst_tensor->set_shape(src_tensor->shape()); in CopyCommonTensor()
640 dst_tensor->set_format(src_tensor->format()); in CopyCommonTensor()
641 dst_tensor->set_data(src_tensor->data()); in CopyCommonTensor()
1710 void CopyTensorList(TensorList *dst_tensor, TensorList *src_tensor) { in CopyTensorList() argument
1711 dst_tensor->set_data_type(src_tensor->data_type()); in CopyTensorList()
1712 dst_tensor->set_format(src_tensor->format()); in CopyTensorList()
1713 dst_tensor->set_element_shape(src_tensor->element_shape()); in CopyTensorList()
1714 dst_tensor->set_shape(src_tensor->shape()); in CopyTensorList()
[all …]
Dtensor.h79 static int CopyTensorData(const Tensor &src_tensor, Tensor *dst_tensor);
81 …static Tensor *CopyTensor(const Tensor &src_tensor, bool copy_data = false, AllocatorPtr allocator…
Dtensorlist.h90 int SetTensor(int index, const Tensor *src_tensor);
Dsub_graph_split.cc650 …mindspore::schema::Tensor *src_tensor = static_cast<schema::Tensor *>(model_->graph_.all_tensors_[… in InitSearchTensor() local
651 auto category = TensorCategory(src_tensor); in InitSearchTensor()
/third_party/mindspore/mindspore/lite/src/delegate/nnrt/checker/
Dprimitive_check.cc124 bool NeedBitUppackCheck(const schema::Tensor &src_tensor) { in NeedBitUppackCheck() argument
125 if (src_tensor.enableHuffmanCode()) { in NeedBitUppackCheck()
128 …bool need_bit_unpack = src_tensor.quantParams() != nullptr && src_tensor.quantParams()->size() > 0… in NeedBitUppackCheck()
129 src_tensor.quantParams()->Get(0) != nullptr; in NeedBitUppackCheck()
131 auto num_bits = src_tensor.quantParams()->Get(0)->numBits(); in NeedBitUppackCheck()
137 int DecompressTensor(const schema::Tensor &src_tensor) { in DecompressTensor() argument
138 if (src_tensor.weightQunatCompressType() == schema::WeightQunatCompressType_FSE || in DecompressTensor()
139 src_tensor.weightQunatCompressType() == schema::WeightQunatCompressType_INDEXING || in DecompressTensor()
140 src_tensor.weightQunatCompressType() == schema::WeightQunatCompressType_SPARSE) { in DecompressTensor()
143 if (!NeedBitUppackCheck(src_tensor)) { in DecompressTensor()
/third_party/mindspore/mindspore/lite/tools/common/
Dtensor_util.cc153 int UpdateTensorTFromTensorInfo(const tensor::TensorPtr &src_tensor, std::unique_ptr<schema::Tensor… in UpdateTensorTFromTensorInfo() argument
154 if (src_tensor == nullptr) { in UpdateTensorTFromTensorInfo()
164 schema_tensor->dataType = src_tensor->data_type(); in UpdateTensorTFromTensorInfo()
165 auto &shape_vector = src_tensor->shape(); in UpdateTensorTFromTensorInfo()
170 if (src_tensor->data().data() != nullptr) { in UpdateTensorTFromTensorInfo()
171 schema_tensor->data.resize(src_tensor->data().nbytes()); in UpdateTensorTFromTensorInfo()
172 …if (EOK != memcpy_s(schema_tensor->data.data(), schema_tensor->data.size(), src_tensor->data().dat… in UpdateTensorTFromTensorInfo()
173 src_tensor->data().nbytes())) { in UpdateTensorTFromTensorInfo()
Dtensor_util.h57 int UpdateTensorTFromTensorInfo(const tensor::TensorPtr &src_tensor, std::unique_ptr<schema::Tensor…
/third_party/mindspore/mindspore/lite/tools/converter/quantizer/
Dfse_decoder.cc109 int FSEDecoder::DeCompress(const schema::Tensor &src_tensor, Tensor *dst_tensor) { in DeCompress() argument
115 CHECK_NULL_RETURN(src_tensor.data()); in DeCompress()
116 auto total_size = src_tensor.data()->size(); in DeCompress()
124 auto data8 = const_cast<unsigned char *>(src_tensor.data()->data()); in DeCompress()
Dfse_decoder.h30 static int DeCompress(const schema::Tensor &src_tensor, Tensor *dst_tensor);
/third_party/mindspore/mindspore/lite/src/train/
Dtrain_export.cc106 int TrainExport::QuantTensorData(schema::TensorT *dest_tensor, const lite::Tensor *src_tensor) { in QuantTensorData() argument
110 if (src_tensor->quant_params().size() > 0) { in QuantTensorData()
111 channels = src_tensor->quant_params().size(); in QuantTensorData()
112 bit_num = src_tensor->quant_params().at(0).bitNum; in QuantTensorData()
120 std::vector<int8_t> data(src_tensor->ElementsNum()); in QuantTensorData()
125 …ret = DoPerLayerQuant<int8_t>(reinterpret_cast<float *>(src_tensor->data()), src_tensor->ElementsN… in QuantTensorData()
128 bool channel_at_first = (src_tensor->shape().at(0) == channels); in QuantTensorData()
129 …ret = DoPerChannelQuant<int8_t>(reinterpret_cast<float *>(src_tensor->data()), src_tensor->Element… in QuantTensorData()
Dtrain_export.h77 …rtual int QuantTensorData(schema::TensorT *dest_tensor, const mindspore::lite::Tensor *src_tensor);