Home
last modified time | relevance | path

Searched refs:tensors (Results 1 – 25 of 101) sorted by relevance

12345

/third_party/mindspore/mindspore/lite/test/ut/src/runtime/
Druntime_pass_tests.cc24 …d Nc4hw4PassAct(std::vector<kernel::LiteKernel *> *kernels, std::vector<Tensor *> *tensors, int i);
33 …4hw4PassConstruct(std::vector<kernel::LiteKernel *> *kernels, std::vector<lite::Tensor *> *tensors, in Nc4hw4PassConstruct() argument
38 tensors->push_back(conv_in_tensor); in Nc4hw4PassConstruct()
40 tensors->push_back(conv_weight); in Nc4hw4PassConstruct()
42 tensors->push_back(conv_out_tensor); in Nc4hw4PassConstruct()
55 tensors->push_back(trans_param_tensor); in Nc4hw4PassConstruct()
57 tensors->push_back(trans_param_tensor); in Nc4hw4PassConstruct()
68 tensors->push_back(in_param_tensor); in Nc4hw4PassConstruct()
70 tensors->push_back(in_out_tensor); in Nc4hw4PassConstruct()
81 tensors->push_back(trans_param_tensor); in Nc4hw4PassConstruct()
[all …]
/third_party/mindspore/mindspore/lite/micro/coder/opcoders/custom/
Dcustom_coder.cc66 …:TransformTensors(Serializer *code, std::string array_name, const std::vector<Tensor *> &tensors) { in TransformTensors() argument
67 if (tensors.size() > MAX_TENSORS) { in TransformTensors()
71 (*code) << "\t\tTensorC " << array_name << "[" << tensors.size() << "];\n"; in TransformTensors()
72 for (size_t i = 0; i < tensors.size(); ++i) { in TransformTensors()
73 if (tensors[i]->category() == Tensor::Category::CONST_TENSOR) { in TransformTensors()
74 if (!const_tensor_map_.count(tensors[i])) { in TransformTensors()
79 << "].data_ = " << allocator_->GetRuntimeAddr(const_tensor_map_[tensors[i]]) << ";\n"; in TransformTensors()
81 …\t\t" << array_name << "[" << i << "].data_ = " << allocator_->GetRuntimeAddr(tensors[i]) << ";\n"; in TransformTensors()
83 for (size_t j = 0; j < tensors[i]->shape().size(); ++j) { in TransformTensors()
84 …(*code) << "\t\t" << array_name << "[" << i << "].shape_[" << j << "] = " << tensors[i]->shape()[j… in TransformTensors()
[all …]
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/somas/
Dsomas_solver_pre.cc32 auto tensors = *pTensors; in CheckTensors() local
33 if (tensors[index1] == nullptr) { in CheckTensors()
37 if (tensors[index2] == nullptr) { in CheckTensors()
42 if (tensors[index1]->right_) in CheckTensors()
44 << " already has a right tensor (id: " << tensors[index1]->right_->index_; in CheckTensors()
45 if (tensors[index2]->left_) in CheckTensors()
47 << " already has a left tensor (id: " << tensors[index2]->left_->index_; in CheckTensors()
51 auto &tensors = *pTensors; in AddContiguousInfoInMap() local
60 tensors[index1]->right_ = tensors[index2]; in AddContiguousInfoInMap()
61 tensors[index2]->left_ = tensors[index1]; in AddContiguousInfoInMap()
[all …]
Dsomas_solver_pre.h189 Status Solving(const session::KernelGraph *graph, TensorsDescMap *tensors,
196 void Log(const session::KernelGraph *graph, const TensorsDescMap &tensors,
206 void SolverInputLog(const session::KernelGraph *graph, const TensorsDescMap &tensors,
208 void SolverOutputLog(const session::KernelGraph *graph, const TensorsDescMap &tensors) const;
209 vector<TensorsDescMap> CreateTensorsMaps(const TensorsDescMap &tensors, size_t total_sol);
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/control/
Dtensorlist_setitem.cc81 if (IncrementOutputSize(output0_->tensors().size()) != RET_OK) { in Run()
94 if (output0_->tensors().empty() && input0_->tensors().empty()) { in Run()
101 if (input0_->tensors().empty() && index_ == 0) { in Run()
113 auto &tensors = output0_->tensors(); in Run() local
114 tensors.emplace_back(dst); in Run()
134 auto &tensors = output0_->tensors(); in Run() local
135 tensors.emplace_back(dst); in Run()
/third_party/mindspore/mindspore/lite/java/java/fl_client/src/main/java/com/mindspore/flclient/model/
DSessionUtil.java50 public static Map<String, float[]> convertTensorToFeatures(List<MSTensor> tensors) { in convertTensorToFeatures() argument
51 if (tensors == null) { in convertTensorToFeatures()
55 Map<String, float[]> features = new HashMap<>(tensors.size()); in convertTensorToFeatures()
56 for (MSTensor mstensor : tensors) { in convertTensorToFeatures()
92 List<MSTensor> tensors = new ArrayList<MSTensor>(featureMaps.size()); in updateFeatures() local
102 tensors.add(new MSTensor(newFeature.weightFullname(), newData)); in updateFeatures()
104 boolean isSuccess = trainSession.updateFeatures(tensors); in updateFeatures()
105 for (MSTensor tensor : tensors) { in updateFeatures()
/third_party/mindspore/tests/st/ops/graph_kernel/
Dtest_addn.py33 def get_output(*tensors): argument
35 output = net(tensors)
41 tensors = []
46 tensors.append(Tensor(t))
48 output = get_output(*tensors).asnumpy()
/third_party/mindspore/mindspore/lite/src/runtime/
Druntime_pass.cc25 void Nc4hw4PassReplace(std::vector<kernel::LiteKernel *> *kernels, std::vector<Tensor *> *tensors, … in Nc4hw4PassReplace() argument
36 VectorSetNull(tensors, transpose_param_tensor); in Nc4hw4PassReplace()
44 VectorSetNull(tensors, c4_input_tensor); in Nc4hw4PassReplace()
51 VectorSetNull(tensors, transpose_param_tensor); in Nc4hw4PassReplace()
64 VectorSetNull(tensors, trans_out); in Nc4hw4PassReplace()
156 void Nc4hw4PassAct(std::vector<kernel::LiteKernel *> *kernels, std::vector<Tensor *> *tensors, int … in Nc4hw4PassAct() argument
170 Nc4hw4PassAct(&particial_nodes, tensors, i); in Nc4hw4PassAct()
174 Nc4hw4PassReplace(kernels, tensors, index); in Nc4hw4PassAct()
230 void RuntimePass(std::vector<kernel::LiteKernel *> *subgraphs, std::vector<Tensor *> *tensors) { in RuntimePass() argument
239 Nc4hw4PassAct(&kernels, tensors, i); in RuntimePass()
/third_party/mindspore/mindspore/lite/java/java/app/src/main/java/com/mindspore/lite/
DLiteSession.java146 ArrayList<MSTensor> tensors = new ArrayList<MSTensor>(); in getInputs() local
149 tensors.add(msTensor); in getInputs()
151 return tensors; in getInputs()
176 ArrayList<MSTensor> tensors = new ArrayList<>(); in getOutputsByNodeName() local
179 tensors.add(msTensor); in getOutputsByNodeName()
181 return tensors; in getOutputsByNodeName()
324 ArrayList<MSTensor> tensors = new ArrayList<MSTensor>(); in getFeaturesMap() local
327 tensors.add(msTensor); in getFeaturesMap()
329 return tensors; in getFeaturesMap()
/third_party/mindspore/mindspore/lite/java/java/linux_x86/src/main/java/com.mindspore.lite/
DLiteSession.java146 ArrayList<MSTensor> tensors = new ArrayList<MSTensor>(); in getInputs() local
149 tensors.add(msTensor); in getInputs()
151 return tensors; in getInputs()
176 ArrayList<MSTensor> tensors = new ArrayList<>(); in getOutputsByNodeName() local
179 tensors.add(msTensor); in getOutputsByNodeName()
181 return tensors; in getOutputsByNodeName()
324 ArrayList<MSTensor> tensors = new ArrayList<MSTensor>(); in getFeaturesMap() local
327 tensors.add(msTensor); in getFeaturesMap()
329 return tensors; in getFeaturesMap()
/third_party/mindspore/mindspore/_extends/graph_kernel/model/
Dmodel_builder.py121 self.tensors = {} # name : Tensor
146 self.tensors[name] = builder.tensor(
151 self.tensors[name] = builder.tensor(
154 … inputs = [self.tensors[d['tensor_name']] for x in op['input_desc'] for d in x if 'value' not in d]
162 self.tensors[name] = output
164 output = self.tensors.get(name, None)
167 self.tensors[name] = output
209 z = inplace_assign_z if inplace_assign_z is not None else self.tensors[t.name]
216 if self.tensors[y].op in graph_ops:
217 … z, fake = (inplace_assign_z, False) if inplace_assign_z is not None else (self.tensors[y], True)
[all …]
/third_party/mindspore/mindspore/lite/src/runtime/kernel/arm/base/
Dgroup_convolution_creator.cc107 void GroupConvCreator::CopyQuantParam(std::vector<lite::Tensor *> *tensors) { in CopyQuantParam() argument
109 CopyTensorQuantParam(tensors->at(j), origin_inputs_.at(j)); in CopyQuantParam()
127 int GroupConvCreator::NewInputTensor(std::vector<lite::Tensor *> *tensors) { in NewInputTensor() argument
133 tensors->emplace_back(in_tensor); in NewInputTensor()
137 int GroupConvCreator::NewOutputTensor(std::vector<lite::Tensor *> *tensors, lite::Tensor *output) { in NewOutputTensor() argument
145 tensors->emplace_back(out_tensor); in NewOutputTensor()
149 int GroupConvCreator::NewConstTensor(std::vector<lite::Tensor *> *tensors, int group_id) { in NewConstTensor() argument
159 tensors->emplace_back(const_tensor); in NewConstTensor()
Dgroup_convolution_creator.h54 void CopyQuantParam(std::vector<lite::Tensor *> *tensors);
64 int NewInputTensor(std::vector<lite::Tensor *> *tensors);
65 int NewConstTensor(std::vector<lite::Tensor *> *tensors, int group_id);
66 int NewOutputTensor(std::vector<lite::Tensor *> *tensors, lite::Tensor *output);
/third_party/mindspore/mindspore/lite/src/common/
Dtensor_util.cc25 int OutputTensor2TensorC(const std::vector<lite::Tensor *> &tensors, std::vector<TensorC *> *tensor… in OutputTensor2TensorC() argument
27 for (size_t i = 0; i < tensors.size(); ++i) { in OutputTensor2TensorC()
107 dst->element_num_ = src->shape().empty() ? 0 : src->tensors().size(); in TensorList2TensorListC()
120 auto ret = Tensor2TensorC(src->tensors().at(i), &dst->tensors_[i]); in TensorList2TensorListC()
237 int CheckTensorsInvalid(const std::vector<Tensor *> &tensors) { in CheckTensorsInvalid() argument
238 for (auto &tensor : tensors) { in CheckTensorsInvalid()
267 std::vector<mindspore::MSTensor> tensors; in LiteTensorsToMSTensors() local
268 …std::transform(lite_tensors.begin(), lite_tensors.end(), std::back_inserter(tensors), [](lite::Ten… in LiteTensorsToMSTensors()
272 return tensors; in LiteTensorsToMSTensors()
/third_party/mindspore/mindspore/lite/src/runtime/kernel/opencl/
Dopencl_subgraph.cc53 auto tensors = (mem_type == MemType::IMG) ? iv->in_tensors() : iv->out_tensors(); in ReplaceOutTensorAndKernelToConvert() local
54 …auto ft = std::find_if(tensors.begin(), tensors.end(), [&](lite::Tensor *kv) { return kv == in_ten… in ReplaceOutTensorAndKernelToConvert()
55 if (ft != tensors.end()) { in ReplaceOutTensorAndKernelToConvert()
58 tensors.emplace_back(new_tensor); in ReplaceOutTensorAndKernelToConvert()
62 iv->set_in_tensors(tensors); in ReplaceOutTensorAndKernelToConvert()
66 iv->set_out_tensors(tensors); in ReplaceOutTensorAndKernelToConvert()
153 auto tensors = iv->in_tensors(); in GenToFormatOp() local
154 auto jv = std::find(tensors.begin(), tensors.end(), in_tensors.at(i)); in GenToFormatOp()
155 if (jv != tensors.end()) { in GenToFormatOp()
157 iv->set_in_tensors(tensors); in GenToFormatOp()
/third_party/mindspore/mindspore/ccsrc/runtime/framework/actor/
Ddata_prepare_actor.cc208 const auto &tensors = input_tensors[i]; in PrepareDataForDeviceTensorStore() local
211 const auto &input_tensor = tensors[j]; in PrepareDataForDeviceTensorStore()
239 const auto &tensors = input_tensors[i]; in PrepareDataForHostTensorQueue() local
242 const auto &input_tensor = tensors[j]; in PrepareDataForHostTensorQueue()
283 const auto &tensors = input_tensors[i]; in PrepareDataForStepMode() local
286 const auto &input_tensor = tensors[j]; in PrepareDataForStepMode()
340 std::vector<TensorPtr> tensors; in PrepareDataForValueNodeTensor() local
341 TensorValueToTensor(node_value, &tensors); in PrepareDataForValueNodeTensor()
342 for (size_t i = 0; i < tensors.size(); i++) { in PrepareDataForValueNodeTensor()
343 const auto &tensor = tensors[i]; in PrepareDataForValueNodeTensor()
[all …]
/third_party/mindspore/mindspore/lite/tools/optimizer/fusion/
Dconstant_folding_fusion.cc58 std::vector<Tensor *> tensors; in GetCNodeInputTensors() local
85 FreeTensors(&tensors, nullptr); in GetCNodeInputTensors()
93 FreeTensors(&tensors, nullptr); in GetCNodeInputTensors()
101 FreeTensors(&tensors, nullptr); in GetCNodeInputTensors()
105 FreeTensors(&tensors, nullptr); in GetCNodeInputTensors()
114 FreeTensors(&tensors, nullptr); in GetCNodeInputTensors()
118 tensors.emplace_back(tensor); in GetCNodeInputTensors()
124 FreeTensors(&tensors, nullptr); in GetCNodeInputTensors()
129 FreeTensors(&tensors, nullptr); in GetCNodeInputTensors()
132 tensors.emplace_back(tensor); in GetCNodeInputTensors()
[all …]
/third_party/mindspore/mindspore/lite/tools/common/
Dtensor_util.h84 ~TensorCache() { tensors.clear(); } in ~TensorCache()
95 tensors.push_back(tensor); in AddTensor()
126 const std::vector<TensorT *> &GetCachedTensor() const { return tensors; } in GetCachedTensor()
131 std::vector<TensorT *> tensors;
/third_party/mindspore/mindspore/lite/tools/converter/parser/tflite/
Dtflite_split_v_parser.cc44 …if (GetTfliteData(tflite_op->inputs[1], tflite_subgraph->tensors, tflite_model->buffers, &size_spl… in Parse()
50 const auto &tensor = tflite_subgraph->tensors.at(tflite_op->inputs.at(0)); in Parse()
56 const auto &axis_tensor = tflite_subgraph->tensors.at(tflite_op->inputs.at(2)); in Parse()
Dtflite_model_parser.cc68 auto all_singraph_tensor_size = subgraph->tensors.size(); in TfliteModelVerify()
96 for (auto &tensor : subgraph->tensors) { in TfliteModelVerify()
393 input_idx += tflite_subgraph->tensors.size(); in ConvertOpQuantParams()
395 const auto &input_tensor = tflite_subgraph->tensors[input_idx]; in ConvertOpQuantParams()
408 output_idx += tflite_subgraph->tensors.size(); in ConvertOpQuantParams()
410 const auto &output_tensor = tflite_subgraph->tensors.at(output_idx); in ConvertOpQuantParams()
431 tflite_graph_input = tflite_graph_input + tflite_subgraph->tensors.size(); in ConvertGraphInputs()
435 const auto &tensor = tflite_subgraph->tensors.at(tflite_graph_input); in ConvertGraphInputs()
468 … auto output_idx = output_node < 0 ? output_node + tflite_subgraph->tensors.size() : output_node; in ConvertGraphOutputs()
508 … ? static_cast<int>(tflite_subgraph->outputs.front() + tflite_subgraph->tensors.size()) in ConvertGraphOutputs()
[all …]
/third_party/mindspore/mindspore/lite/tools/converter/legacy_optimizer/graph/
Dinfershape_pass.cc118 std::vector<Tensor *> tensors{}; in ConvertTensorList() local
125 tensors.emplace_back(tensor); in ConvertTensorList()
131 lite_tensor_list->set_tensors(tensors); in ConvertTensorList()
269 …(MetaGraphT *graph, const std::vector<Tensor *> &output_tensors, std::vector<InferTensor> *tensors, in SetDataType() argument
278 if (!tensor_list->tensors().empty()) { in SetDataType()
279 tensor_shape_dims = static_cast<int>(tensor_list->tensors().front()->shape().size()); in SetDataType()
287 if (!tensor_list->tensors().empty()) { in SetDataType()
288 tensor_list->set_tensors_data_type(tensor_list->tensors().front()->data_type()); in SetDataType()
292 if (tensor_list->element_shape().empty() && !tensor_list->tensors().empty()) { in SetDataType()
293 tensor_list->set_element_shape(tensor_list->tensors().front()->shape()); in SetDataType()
[all …]
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/opencl/
Dcommon.cc232 std::vector<std::shared_ptr<Tensor>> tensors; in TestMain() local
234tensors.reserve(input_infos.size()); // vector's capacity() is 0, so call reserve() avoiding vect… in TestMain()
239 tensors.emplace_back(std::make_shared<Tensor>(data_type, shape, mindspore::NHWC, category)); in TestMain()
245 for (int i = 0; i < tensors.size(); ++i) { in TestMain()
246 auto tensor = tensors[i]; in TestMain()
325 for (int i = 0; i < tensors.size(); ++i) { in TestMain()
326 auto &tensor = tensors[i]; in TestMain()
353 for (auto &tensor : tensors) { in TestMain()
358 for (int i = 0, j = 0; i < tensors.size(); ++i) { // resume weight data to input_infos in TestMain()
359 auto &tensor = tensors[i]; in TestMain()
/third_party/mindspore/mindspore/profiler/parser/
Dmemory_usage_parser.py180 self.tensors = OrderedDict()
225 self.allocations = len(self.tensors)
226 self.deallocations = len(self.tensors)
235 self.tensors.update({tensor.tensor_id: tensor})
279 tensor = self.tensors.get(t_id)
298 tensor = self.tensors[t_id]
307 for tensor_id, tensor in self.tensors.items():
366 tensor = self.tensors.get(t_id)
/third_party/mindspore/mindspore/ccsrc/cxx_api/model/acl/acl_vm/
Dms_tensor_ref.cc20 VectorRef MSTensorRef::Convert(const std::vector<MSTensor> &tensors) { in Convert() argument
22 std::transform(tensors.begin(), tensors.end(), std::back_inserter(res), in Convert()
/third_party/mindspore/mindspore/ccsrc/runtime/framework/
Dhost_tensor_queue.h36 void Push(const std::vector<TensorPtr> &tensors) { buffers_.push(tensors); } in Push() argument

12345