/third_party/mindspore/mindspore/lite/java/native/runtime/ |
D | ms_tensor.cpp | 24 jlong tensor_ptr) { in Java_com_mindspore_lite_MSTensor_getShape() argument 25 auto *pointer = reinterpret_cast<void *>(tensor_ptr); in Java_com_mindspore_lite_MSTensor_getShape() 44 jlong tensor_ptr) { in Java_com_mindspore_lite_MSTensor_getDataType() argument 45 auto *pointer = reinterpret_cast<void *>(tensor_ptr); in Java_com_mindspore_lite_MSTensor_getDataType() 55 … jlong tensor_ptr) { in Java_com_mindspore_lite_MSTensor_getByteData() argument 56 auto *pointer = reinterpret_cast<void *>(tensor_ptr); in Java_com_mindspore_lite_MSTensor_getByteData() 79 … jlong tensor_ptr) { in Java_com_mindspore_lite_MSTensor_getLongData() argument 80 auto *pointer = reinterpret_cast<void *>(tensor_ptr); in Java_com_mindspore_lite_MSTensor_getLongData() 109 … jlong tensor_ptr) { in Java_com_mindspore_lite_MSTensor_getIntData() argument 110 auto *pointer = reinterpret_cast<void *>(tensor_ptr); in Java_com_mindspore_lite_MSTensor_getIntData() [all …]
|
/third_party/mindspore/mindspore/core/base/ |
D | base_ref_utils.cc | 25 auto tensor_ptr = utils::cast<std::shared_ptr<tensor::Tensor>>(ref_list[i]); in IterateFindTensor() local 26 MS_EXCEPTION_IF_NULL(tensor_ptr); in IterateFindTensor() 27 msTensors->emplace_back(tensor_ptr); in IterateFindTensor() 43 auto tensor_ptr = utils::cast<std::shared_ptr<tensor::Tensor>>(base_ref); in TransformVectorRefToMultiTensor() local 44 MS_EXCEPTION_IF_NULL(tensor_ptr); in TransformVectorRefToMultiTensor() 45 msTensors.emplace_back(tensor_ptr); in TransformVectorRefToMultiTensor()
|
/third_party/mindspore/mindspore/lite/src/ |
D | tensorlist.cc | 105 auto tensor_ptr = new (std::nothrow) Tensor(dtype, tensor_shape[i]); in MallocTensorListData() local 106 if (tensor_ptr == nullptr) { in MallocTensorListData() 111 tensor_ptr->set_allocator(this->allocator()); in MallocTensorListData() 113 tensor_ptr->set_init_ref_count(this->init_ref_count()); in MallocTensorListData() 114 tensor_ptr->set_ref_count(this->ref_count()); in MallocTensorListData() 115 this->tensors_.push_back(tensor_ptr); in MallocTensorListData() 129 auto tensor_ptr = this->tensors_[i]; in MallocData() local 130 if (tensor_ptr == nullptr) { in MallocData() 135 if (tensor_ptr->data_type() != kTypeUnknown) { in MallocData() 136 auto ret = tensor_ptr->MallocData(this->allocator_); in MallocData()
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/pass/ |
D | convert_const_input_to_tensor_input.cc | 37 tensor::TensorPtr tensor_ptr = nullptr; in CreateTensorInput() local 39 tensor_ptr = ScalarToTensor(value->cast<ScalarPtr>()); in CreateTensorInput() 41 tensor_ptr = CreateTupleTensor(value->cast<ValueTuplePtr>()); in CreateTensorInput() 45 if (tensor_ptr == nullptr) { in CreateTensorInput() 49 auto tensor_input = std::make_shared<ValueNode>(tensor_ptr); in CreateTensorInput() 51 tensor_input->set_abstract(tensor_ptr->ToAbstract()); in CreateTensorInput()
|
D | convert_const_scalar_to_tensor.cc | 39 tensor::TensorPtr tensor_ptr = ScalarToTensor(value->cast<ScalarPtr>()); in CreateTensorInput() local 40 if (tensor_ptr == nullptr) { in CreateTensorInput() 44 auto tensor_input = std::make_shared<ValueNode>(tensor_ptr); in CreateTensorInput() 46 tensor_input->set_abstract(tensor_ptr->ToAbstract()); in CreateTensorInput()
|
/third_party/mindspore/mindspore/ccsrc/utils/ |
D | callbacks_ge.cc | 99 TensorPtr tensor_ptr = GetMeTensorTransformed(graph_id, name, ge_tensor_ptr); in CheckpointSaveCallback() local 100 if (tensor_ptr == nullptr) { in CheckpointSaveCallback() 105 param_dict["data"] = tensor_ptr; in CheckpointSaveCallback() 168 TensorPtr tensor_ptr = GetMeTensorForSummary(tag_name, ge_tensor_ptr); in SummarySaveCallback() local 169 if (tensor_ptr == nullptr) { in SummarySaveCallback() 174 summary_value_dict["data"] = tensor_ptr; in SummarySaveCallback()
|
D | callbacks.cc | 46 auto tensor_ptr = item.second; in SummarySaveCallback() local 47 if (tensor_ptr == nullptr) { in SummarySaveCallback() 52 summary_value_dict["data"] = tensor_ptr; in SummarySaveCallback()
|
D | convert_utils_py.cc | 122 auto tensor_ptr = value->cast<tensor::TensorPtr>(); in __anone0198b6c0202() local 123 return TensorToPyData(tensor_ptr); in __anone0198b6c0202() 242 auto tensor_ptr = value.cast<tensor::TensorPtr>(); in AnyToPyData() local 243 ret = TensorToPyData(tensor_ptr); in AnyToPyData() 285 auto tensor_ptr = utils::cast<tensor::TensorPtr>(value); in BaseRefToPyData() local 286 ret = TensorToPyData(tensor_ptr); in BaseRefToPyData()
|
/third_party/mindspore/mindspore/ccsrc/frontend/optimizer/irpass/ |
D | value_based_eliminate.cc | 48 auto tensor_ptr = value->cast<tensor::TensorPtr>(); in IsNodeScalarTrueWith() local 49 if (tensor_ptr == nullptr) { in IsNodeScalarTrueWith() 52 if (tensor_ptr->DataSize() > 1) { in IsNodeScalarTrueWith() 56 TypeId tensor_type = tensor_ptr->Dtype()->type_id(); in IsNodeScalarTrueWith() 58 float *data = reinterpret_cast<float *>(tensor_ptr->data_c()); in IsNodeScalarTrueWith()
|
/third_party/mindspore/mindspore/core/ir/ |
D | pattern_matcher.h | 580 auto tensor_ptr = dyn_cast<tensor::Tensor>(value); 581 TypeId tensor_type = tensor_ptr->Dtype()->type_id(); 583 float *data2 = reinterpret_cast<float *>(tensor_ptr->data_c()); 585 for (int i = 0; i < tensor_ptr->DataSize(); i++) { 592 double *data2 = reinterpret_cast<double *>(tensor_ptr->data_c()); 594 for (int i = 0; i < tensor_ptr->DataSize(); i++) { 601 int *data2 = reinterpret_cast<int *>(tensor_ptr->data_c()); 602 for (int i = 0; i < tensor_ptr->DataSize(); i++) { 617 auto tensor_ptr = dyn_cast<tensor::Tensor>(value); 618 if ((tensor_ptr->DataSize() > 1) || (tensor_ptr->DataDim() > 0)) { [all …]
|
/third_party/mindspore/tests/ut/cpp/ir/ |
D | meta_tensor_test.cc | 157 std::shared_ptr<Tensor> tensor_ptr = std::make_shared<Tensor>(tensor); in TEST_F() local 160 ASSERT_EQ(TypeId::kNumberTypeInt64, tensor_ptr->data_type()); in TEST_F() 163 ASSERT_EQ(0, tensor_ptr->DataDim()); in TEST_F() 166 ASSERT_EQ(0, tensor_ptr->shape().size()); in TEST_F() 168 ASSERT_EQ(empty_shape, tensor_ptr->shape()); in TEST_F() 171 ASSERT_EQ(1, tensor_ptr->ElementsNum()); in TEST_F() 172 ASSERT_EQ(1, tensor_ptr->DataSize()); in TEST_F()
|
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/ascend/ir_fusion/ |
D | fused_batch_norm_fusion.cc | 71 auto tensor_ptr = value->cast<tensor::TensorPtr>(); in GetFactor() local 72 MS_EXCEPTION_IF_NULL(tensor_ptr); in GetFactor() 73 if (tensor_ptr->data_type() == kNumberTypeFloat16) { in GetFactor() 74 auto *half_data = static_cast<const float16 *>(tensor_ptr->data_c()); in GetFactor() 78 } else if (tensor_ptr->data_type() == kNumberTypeFloat32) { in GetFactor() 79 auto *tensor_data = static_cast<const float *>(tensor_ptr->data_c()); in GetFactor()
|
/third_party/mindspore/mindspore/lite/test/ut/src/runtime/kernel/arm/int8/ |
D | fullconnection_int8_tests.cc | 47 auto tensor_ptr = reinterpret_cast<int *>(tensor->MutableData()); in MakeIntTensor() local 48 memcpy(tensor_ptr, data, len * sizeof(int)); in MakeIntTensor()
|
D | matmul_int8_tests.cc | 53 auto tensor_ptr = reinterpret_cast<int8_t *>(tensor->MutableData()); in MakeQuantTensor() local 54 memcpy(tensor_ptr, data, len * sizeof(int8_t)); in MakeQuantTensor()
|
/third_party/mindspore/mindspore/ccsrc/debug/debugger/ |
D | proto_exporter.cc | 154 tensor::TensorPtr tensor_ptr = dyn_cast<tensor::Tensor>(val); in SetValueToProto() local 157 tensor_proto->set_data_type(GetDebuggerNumberDataType(tensor_ptr->Dtype())); in SetValueToProto() 158 for (auto &elem : tensor_ptr->shape()) { in SetValueToProto() 161 tensor_proto->set_tensor_content(tensor_ptr->data_c(), tensor_ptr->data().nbytes()); in SetValueToProto()
|
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/graph_util/ |
D | generate_graph.cc | 86 mindspore::tensor::TensorPtr tensor_ptr = std::make_shared<tensor::Tensor>(value, kInt32); in CreateInt32Tensor() local 87 ValuePtr value_ptr = MakeValue(tensor_ptr); in CreateInt32Tensor()
|
/third_party/mindspore/mindspore/ccsrc/backend/session/ |
D | cpu_session.cc | 252 auto tensor_ptr = utils::cast<std::shared_ptr<tensor::Tensor>>(base_ref[i]); in SetOutputFlags() local 253 tensor_ptr->SetNeedWait(false); in SetOutputFlags() 254 tensor_ptr->data_sync(false); in SetOutputFlags()
|
D | anf_runtime_algorithm.cc | 957 auto tensor_ptr = type_ptr->cast<TensorTypePtr>(); in GetOutputInferDataType() local 958 MS_EXCEPTION_IF_NULL(tensor_ptr); in GetOutputInferDataType() 959 TypePtr elem = tensor_ptr->element(); in GetOutputInferDataType() 2237 auto tensor_ptr = iter_tensor->second; in InferShape() local 2238 MS_EXCEPTION_IF_NULL(tensor_ptr); in InferShape() 2240 tensor_ptr->data_sync(); in InferShape() 2243 real_input->abstract()->set_value(tensor_ptr); in InferShape() 2249 tuple_elements->set_value(tensor_ptr); in InferShape()
|
/third_party/mindspore/mindspore/ccsrc/transform/graph_ir/ |
D | util.cc | 196 …GeTensorPtr tensor_ptr = make_shared<GeTensor>(*desc, static_cast<uint8_t *>(tensor->data_c()), da… in ConvertTensor() local 197 if (tensor_ptr != nullptr) { in ConvertTensor() 200 return tensor_ptr; in ConvertTensor()
|
/third_party/mindspore/mindspore/ccsrc/frontend/parallel/ops_info/ |
D | gather_v2_info.cc | 210 …mindspore::tensor::TensorPtr tensor_ptr = std::make_shared<mindspore::tensor::Tensor>(tensor_data,… in CreateSubOp() local 211 ValuePtr op_param_value = MakeValue(tensor_ptr); in CreateSubOp()
|
D | reduce_method_info.cc | 212 …mindspore::tensor::TensorPtr tensor_ptr = std::make_shared<mindspore::tensor::Tensor>(divisor, dty… in CreateReduceMeanForwardOp() local 213 ValuePtr op1_param_value = MakeValue(tensor_ptr); in CreateReduceMeanForwardOp()
|
/third_party/mindspore/mindspore/ccsrc/debug/ |
D | dump_proto.cc | 218 tensor::TensorPtr tensor_ptr = dyn_cast<tensor::Tensor>(val); in SetValueToProto() local 221 tensor_proto->set_data_type(GetNumberDataType(tensor_ptr->Dtype())); in SetValueToProto() 222 for (auto &elem : tensor_ptr->shape()) { in SetValueToProto()
|
/third_party/mindspore/mindspore/ccsrc/pipeline/pynative/ |
D | pynative_execute.cc | 150 auto tensor_ptr = py::cast<tensor::TensorPtr>(obj); in GetId() local 151 return tensor_ptr->id(); in GetId() 434 tensor::TensorPtr tensor_ptr = opt::CreateTupleTensor(value_tuple); in ConvertValueTupleToTensor() local 435 MS_EXCEPTION_IF_NULL(tensor_ptr); in ConvertValueTupleToTensor() 436 input_tensors->emplace_back(tensor_ptr); in ConvertValueTupleToTensor() 465 tensor::TensorPtr tensor_ptr = nullptr; in ConvertPyObjectToTensor() local 467 tensor_ptr = py::cast<tensor::TensorPtr>(input_object); in ConvertPyObjectToTensor() 470 tensor_ptr = std::make_shared<tensor::Tensor>(input_value, kFloat32); in ConvertPyObjectToTensor() 473 tensor_ptr = std::make_shared<tensor::Tensor>(py::cast<int64_t>(input_object), kInt64); in ConvertPyObjectToTensor() 476 tensor_ptr = TensorPy::MakeTensor(py::cast<py::array>(input_object), nullptr); in ConvertPyObjectToTensor() [all …]
|
/third_party/mindspore/mindspore/ccsrc/vm/ |
D | backend.cc | 577 tensor::TensorPtr tensor_ptr = opt::CreateTupleTensor(value_tuple); in ConvertValueTupleToTensor() local 578 MS_EXCEPTION_IF_NULL(tensor_ptr); in ConvertValueTupleToTensor() 579 (void)tensors->emplace_back(tensor_ptr); in ConvertValueTupleToTensor()
|
/third_party/mindspore/mindspore/ccsrc/runtime/device/ |
D | kernel_adjust.cc | 519 tensor::TensorPtr tensor_ptr = std::make_shared<tensor::Tensor>(kInt32->type_id(), shp); in CreateSwitchOpParameters() local 520 MS_EXCEPTION_IF_NULL(tensor_ptr); in CreateSwitchOpParameters() 521 mindspore::abstract::AbstractBasePtr paremeter_abstract_ptr = tensor_ptr->ToAbstract(); in CreateSwitchOpParameters()
|