/aosp_15_r20/external/pytorch/test/cpp/lazy/ |
H A D | test_lazy_ops_util.cpp | 43 bool EqualValues(at::Tensor tensor1, at::Tensor tensor2) { in EqualValues() argument 44 tensor1 = ToCpuTensor(tensor1); in EqualValues() 46 if (torch::isnan(tensor1).any().item<bool>()) { in EqualValues() 47 EXPECT_TRUE(EqualValues(torch::isnan(tensor1), torch::isnan(tensor2))); in EqualValues() 48 tensor1.nan_to_num_(); in EqualValues() 51 if (tensor1.sizes() != tensor2.sizes() || in EqualValues() 52 tensor1.dtype() != tensor2.dtype()) { in EqualValues() 54 << tensor1.dtype() << " " << tensor1.sizes() << "\n-vs-\n" in EqualValues() 58 at::ScalarType type1 = tensor1.scalar_type(); in EqualValues() 61 tensor1 = tensor1.toType(type2); in EqualValues() [all …]
|
/aosp_15_r20/external/armnn/delegate/test/ |
H A D | TestUtils.cpp | 11 void CompareData(bool tensor1[], bool tensor2[], size_t tensorSize) in CompareData() argument 16 CHECK(compareBool(tensor1[i], tensor2[i])); in CompareData() 20 void CompareData(std::vector<bool>& tensor1, std::vector<bool>& tensor2, size_t tensorSize) in CompareData() argument 25 CHECK(compareBool(tensor1[i], tensor2[i])); in CompareData() 29 void CompareData(float tensor1[], float tensor2[], size_t tensorSize) in CompareData() argument 33 CHECK(tensor1[i] == doctest::Approx( tensor2[i] )); in CompareData() 37 void CompareData(float tensor1[], float tensor2[], size_t tensorSize, float percentTolerance) in CompareData() argument 41 CHECK(std::max(tensor1[i], tensor2[i]) - std::min(tensor1[i], tensor2[i]) <= in CompareData() 42 std::abs(tensor1[i]*percentTolerance/100)); in CompareData() 46 void CompareData(uint8_t tensor1[], uint8_t tensor2[], size_t tensorSize) in CompareData() argument [all …]
|
H A D | TestUtils.hpp | 25 void CompareData(std::vector<bool>& tensor1, std::vector<bool>& tensor2, size_t tensorSize); 26 void CompareData(bool tensor1[], bool tensor2[], size_t tensorSize); 29 void CompareData(float tensor1[], float tensor2[], size_t tensorSize); 32 void CompareData(float tensor1[], float tensor2[], size_t tensorSize, float percentTolerance); 35 void CompareData(int8_t tensor1[], int8_t tensor2[], size_t tensorSize); 38 void CompareData(uint8_t tensor1[], uint8_t tensor2[], size_t tensorSize); 41 void CompareData(int16_t tensor1[], int16_t tensor2[], size_t tensorSize); 44 void CompareData(int32_t tensor1[], int32_t tensor2[], size_t tensorSize); 47 void CompareData(Half tensor1[], Half tensor2[], size_t tensorSize); 50 void CompareData(TfLiteFloat16 tensor1[], TfLiteFloat16 tensor2[], size_t tensorSize); [all …]
|
/aosp_15_r20/external/pytorch/aten/src/ATen/test/ |
H A D | basic.cpp | 411 at::Tensor tensor1 = at::empty({4}, at::TensorOptions().dtype(at::kHalf)); in TEST() local 412 ASSERT_EQ(tensor1.dtype(), at::kHalf); in TEST() 413 ASSERT_EQ(tensor1.layout(), at::kStrided); in TEST() 414 ASSERT_EQ(tensor1.device(), at::kCPU); in TEST() 415 ASSERT_FALSE(tensor1.requires_grad()); in TEST() 416 ASSERT_FALSE(tensor1.is_pinned()); in TEST() 421 tensor1 = at::empty({4}, at::TensorOptions().dtype(at::kHalf).layout(at::kSparse)); in TEST() 422 ASSERT_EQ(tensor1.dtype(), at::kHalf); in TEST() 423 ASSERT_EQ(tensor1.layout(), at::kSparse); in TEST() 424 ASSERT_EQ(tensor1.device(), at::kCPU); in TEST() [all …]
|
/aosp_15_r20/external/eigen/unsupported/test/ |
H A D | cxx11_tensor_layout_swap_sycl.cpp | 37 Tensor<DataType, 3, ColMajor, IndexType> tensor1(tensorColRange); in test_simple_swap_sycl() local 39 tensor1.setRandom(); in test_simple_swap_sycl() 41 …DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor1.size()*sizeof(DataType)… in test_simple_swap_sycl() 46 sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(),(tensor1.size())*sizeof(DataType)); in test_simple_swap_sycl() 55 VERIFY_IS_EQUAL(tensor1.dimension(0), tensor2.dimension(2)); in test_simple_swap_sycl() 56 VERIFY_IS_EQUAL(tensor1.dimension(1), tensor2.dimension(1)); in test_simple_swap_sycl() 57 VERIFY_IS_EQUAL(tensor1.dimension(2), tensor2.dimension(0)); in test_simple_swap_sycl() 62 VERIFY_IS_EQUAL(tensor1(i,j,k), tensor2(k,j,i)); in test_simple_swap_sycl() 80 Tensor<DataType, 3, ColMajor, IndexType> tensor1(tensorColRange); in test_swap_as_lvalue_sycl() local 82 tensor1.setRandom(); in test_swap_as_lvalue_sycl() [all …]
|
H A D | cxx11_tensor_morphing.cpp | 19 Tensor<float, 5> tensor1(2,3,1,7,1); in test_simple_reshape() local 20 tensor1.setRandom(); in test_simple_reshape() 27 tensor2 = tensor1.reshape(dim1); in test_simple_reshape() 29 tensor3 = tensor1.reshape(dim2); in test_simple_reshape() 31 tensor4 = tensor1.reshape(dim1).reshape(dim3); in test_simple_reshape() 36 VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor2(i,j,k)); in test_simple_reshape() 37 VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor3(i+2*j,k)); in test_simple_reshape() 38 VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor4(i,j+3*k)); in test_simple_reshape() 74 TensorMap<Tensor<float, 5>> tensor1(m1.data(), 2,3,5,7,11); in test_reshape_in_expr() local 81 tensor3 = tensor1.reshape(newDims1).contract(tensor2.reshape(newDims2), contract_along); in test_reshape_in_expr() [all …]
|
H A D | cxx11_tensor_trace.cpp | 29 Tensor<float, 3, DataLayout> tensor1(5, 5, 5); in test_all_dimensions_trace() local 30 tensor1.setRandom(); in test_all_dimensions_trace() 31 Tensor<float, 0, DataLayout> result1 = tensor1.trace(); in test_all_dimensions_trace() 35 sum += tensor1(i, i, i); in test_all_dimensions_trace() 54 Tensor<float, 3, DataLayout> tensor1(3, 5, 3); in test_simple_trace() local 55 tensor1.setRandom(); in test_simple_trace() 57 Tensor<float, 1, DataLayout> result1 = tensor1.trace(dims1); in test_simple_trace() 64 sum += tensor1(j, i, j); in test_simple_trace()
|
H A D | cxx11_tensor_morphing_sycl.cpp | 39 Tensor<DataType, 5, DataLayout, IndexType> tensor1(dim1); in test_simple_reshape() local 44 tensor1.setRandom(); in test_simple_reshape() 46 …DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor1.size()*sizeof(DataType)… in test_simple_reshape() 56 sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(),(tensor1.size())*sizeof(DataType)); in test_simple_reshape() 59 sycl_device.memcpyDeviceToHost(tensor2.data(), gpu_data2,(tensor1.size())*sizeof(DataType)); in test_simple_reshape() 69 VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor2(i,j,k)); ///ColMajor in test_simple_reshape() 71 VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor3(i+2*j,k)); ///ColMajor in test_simple_reshape() 72 VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor4(i,j+3*k)); ///ColMajor in test_simple_reshape() 75 //VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor2(i,j,k)); /// RowMajor in test_simple_reshape() 76 VERIFY_IS_EQUAL(tensor1(i,j,0,k,0), tensor4(i,j*7 +k)); /// RowMajor in test_simple_reshape() [all …]
|
H A D | cxx11_tensor_image_op_sycl.cpp | 40 Tensor<DataType, 3,DataLayout, IndexType> tensor1(input_range); in test_image_op_sycl() local 57 tensor1.setRandom(); in test_image_op_sycl() 61 …DataType* gpu_data1 = static_cast<DataType*>(sycl_device.allocate(tensor1.size()*sizeof(DataType)… in test_image_op_sycl() 69 sycl_device.memcpyHostToDevice(gpu_data1, tensor1.data(),(tensor1.size())*sizeof(DataType)); in test_image_op_sycl() 74 …tensor3_cpu = tensor1.stridedSlice(indicesStart1,indicesStop1,strides1) - tensor2.stridedSlice(ind… in test_image_op_sycl()
|
/aosp_15_r20/external/pytorch/aten/src/ATen/ |
H A D | CPUApplyUtils.h | 261 inline void CPU_tensor_apply2(Tensor tensor1, Tensor tensor2, const Op op) { in CPU_tensor_apply2() argument 262 if (!_apply_preamble({tensor1, tensor2})) in CPU_tensor_apply2() 264 if (_max_dim_tensors({tensor1, tensor2}) <= 8) { in CPU_tensor_apply2() 266 tensor1.numel(), in CPU_tensor_apply2() 269 strided_tensor_iter_fixed<scalar1, 8>(tensor1), in CPU_tensor_apply2() 273 tensor1.numel(), in CPU_tensor_apply2() 276 strided_tensor_iter<scalar1>(tensor1), in CPU_tensor_apply2() 283 Tensor tensor1, in CPU_tensor_apply3() argument 287 if (!_apply_preamble({tensor1, tensor2, tensor3})) in CPU_tensor_apply3() 289 if (_max_dim_tensors({tensor1, tensor2, tensor3}) <= 8) { in CPU_tensor_apply3() [all …]
|
/aosp_15_r20/external/executorch/runtime/core/exec_aten/testing_util/ |
H A D | tensor_util.h | 41 * Note that gtest users can write `EXPECT_THAT(tensor1, IsCloseTo(tensor2))` or 42 * `EXPECT_THAT(tensor1, Not(IsCloseTo(tensor2)))`, or use the helper macros 45 * For exact equality, use `EXPECT_THAT(tensor1, IsEqualTo(tensor2))` or 46 * `EXPECT_THAT(tensor1, Not(IsEqualTo(tensor2)))`, or the helper macros 80 * Note that gtest users can write `EXPECT_THAT(tensor1, 81 * IsDataCloseTo(tensor2))` or `EXPECT_THAT(tensor1, 85 * For exact equality, use `EXPECT_THAT(tensor1, IsDataEqualTo(tensor2))` or 86 * `EXPECT_THAT(tensor1, Not(IsDataEqualTo(tensor2)))`, or the helper macros 121 * Lets gtest users write `EXPECT_THAT(tensor1, IsCloseTo(tensor2))` or 122 * `EXPECT_THAT(tensor1, Not(IsCloseTo(tensor2)))`. [all …]
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/ |
H A D | PointwiseOps.cpp | 19 const Tensor& tensor1, in TORCH_META_FUNC() 22 build_ternary_op(maybe_get_output(), self, tensor1, tensor2); in TORCH_META_FUNC() 27 const Tensor& tensor1, in TORCH_META_FUNC() 30 if (isIntegralType(tensor1.scalar_type(), /*includeBool=*/true) && in TORCH_META_FUNC() 35 "release addcdiv will perform a true division of tensor1 and tensor2. ", in TORCH_META_FUNC() 37 "(input + value * torch.trunc(tensor1 / tensor2)).to(input.dtype) ", in TORCH_META_FUNC() 39 "(input + value * tensor1 / tensor2) for float inputs. ", in TORCH_META_FUNC() 41 "(input + value * tensor1 / tensor2), for all dtypes."); in TORCH_META_FUNC() 43 build_ternary_op(maybe_get_output(), self, tensor1, tensor2); in TORCH_META_FUNC() 51 const Tensor& tensor1, in TORCH_IMPL_FUNC() [all …]
|
/aosp_15_r20/external/armnn/src/armnnSerializer/test/ |
H A D | SerializerTestUtils.cpp | 122 void CompareConstTensor(const armnn::ConstTensor& tensor1, const armnn::ConstTensor& tensor2) in CompareConstTensor() argument 124 CHECK(tensor1.GetShape() == tensor2.GetShape()); in CompareConstTensor() 125 CHECK(GetDataTypeName(tensor1.GetDataType()) == GetDataTypeName(tensor2.GetDataType())); in CompareConstTensor() 127 switch (tensor1.GetDataType()) in CompareConstTensor() 131 tensor1.GetMemoryArea(), tensor2.GetMemoryArea(), tensor1.GetNumElements()); in CompareConstTensor() 136 tensor1.GetMemoryArea(), tensor2.GetMemoryArea(), tensor1.GetNumElements()); in CompareConstTensor() 140 tensor1.GetMemoryArea(), tensor2.GetMemoryArea(), tensor1.GetNumElements()); in CompareConstTensor() 144 tensor1.GetMemoryArea(), tensor2.GetMemoryArea(), tensor1.GetNumElements()); in CompareConstTensor()
|
/aosp_15_r20/external/pytorch/test/jit/ |
H A D | test_cuda.py | 332 tensor1 = torch.rand(10000, 10000, device="cuda") 333 tensor2 = torch.mm(tensor1, tensor1).to("cuda") 339 tensor1, 521 tensor1 = torch.rand(1000000000, 1000000000, device="cuda") 522 tensor2 = torch.mm(tensor1, tensor1).to("cuda") 543 tensor1 = torch.rand(1000000000, 1000000000, device="cuda") 545 tensor2 = torch.mm(tensor1, tensor1).to("cuda") 569 tensor1 = torch.rand(1000000000, 1000000000, device="cuda") 571 tensor = torch.mm(tensor1, tensor1).to("cuda") 599 tensor1 = torch.rand(1000000000, 1000000000, device="cuda") [all …]
|
/aosp_15_r20/external/pytorch/tools/autograd/ |
H A D | deprecated.yaml | 31 - name: addcdiv(Tensor self, Scalar value, Tensor tensor1, Tensor tensor2) -> Tensor 32 aten: addcdiv(self, tensor1, tensor2, value) 34 - name: addcdiv_(Tensor(a!) self, Scalar value, Tensor tensor1, Tensor tensor2) -> Tensor(a!) 35 aten: addcdiv_(self, tensor1, tensor2, value) 37 - name: addcdiv(Tensor self, Scalar value, Tensor tensor1, Tensor tensor2, *, Tensor(a!) out) -> Te… 38 aten: addcdiv_out(out, self, tensor1, tensor2, value) 40 - name: addcmul(Tensor self, Scalar value, Tensor tensor1, Tensor tensor2) -> Tensor 41 aten: addcmul(self, tensor1, tensor2, value) 43 - name: addcmul_(Tensor(a!) self, Scalar value, Tensor tensor1, Tensor tensor2) -> Tensor(a!) 44 aten: addcmul_(self, tensor1, tensor2, value) [all …]
|
/aosp_15_r20/external/pytorch/aten/src/ATen/native/mps/operations/ |
H A D | PointwiseOps.mm | 17 const Tensor& tensor1, 47 string key = op_name + getTensorsStringKey({self, tensor1, tensor2}); 51 …c10::promoteTypes(self.scalar_type(), c10::promoteTypes(tensor1.scalar_type(), tensor2.scalar_type… 53 newCachedGraph->firstTensor = mpsGraphRankedPlaceHolder(mpsGraph, tensor1); 82 Placeholder tensor1Placeholder = Placeholder(cachedGraph->firstTensor, tensor1); 107 (const Tensor& self, const Tensor& tensor1, const Tensor& tensor2, const Scalar& value, const Tenso… 108 mps::addc_mul_div_out_mps(self, tensor1, tensor2, value, output, false, "addcmul_out_mps"); 112 (const Tensor& self, const Tensor& tensor1, const Tensor& tensor2, const Scalar& value, const Tenso… 113 mps::addc_mul_div_out_mps(self, tensor1, tensor2, value, output, true, "addcdiv_out_mps");
|
/aosp_15_r20/external/executorch/extension/tensor/test/ |
H A D | tensor_ptr_test.cpp | 96 auto tensor1 = make_tensor_ptr({4, 5}, data); in TEST_F() local 97 auto tensor2 = tensor1; in TEST_F() 98 EXPECT_EQ(tensor1.get(), tensor2.get()); in TEST_F() 99 EXPECT_EQ(tensor1->unsafeGetTensorImpl(), tensor2->unsafeGetTensorImpl()); in TEST_F() 322 auto tensor1 = make_tensor_ptr({2, 3}, std::move(data)); in TEST_F() local 323 auto tensor2 = tensor1; in TEST_F() 325 tensor1->mutable_data_ptr<float>()[0] = 10; in TEST_F() 329 EXPECT_EQ(tensor1->const_data_ptr<float>()[5], 20); in TEST_F() 335 auto tensor1 = make_tensor_ptr({3, 4}, std::move(data)); in TEST_F() local 336 auto tensor2 = tensor1; in TEST_F() [all …]
|
/aosp_15_r20/external/pytorch/docs/cpp/source/notes/ |
H A D | tensor_cuda_stream.rst | 151 torch::Tensor tensor1 = torch::ones({2, 2}, torch::device(at::kCUDA)); 153 tensor1.sum(); 161 torch::Tensor tensor1 = torch::ones({2, 2}, torch::device({torch::kCUDA, 1})); 167 // sum() on tensor1 use `myStream1_1` as current CUDA stream on device 1 168 tensor1.sum(); 174 // sum() on tensor1 uses `myStream1` as current CUDA stream on device 1 175 tensor1.sum(); 187 torch::Tensor tensor1 = torch::ones({2, 2}, torch::device({torch::kCUDA, 1})); 200 // sum() on tensor1 uses `myStream1` as current CUDA stream on device 1 201 tensor1.sum(); [all …]
|
/aosp_15_r20/external/pytorch/test/distributed/checkpoint/ |
H A D | test_state_dict_utils.py | 79 "tensor1": torch.arange(10, device=device), 87 self.assertEqual(cpu_state_dict["tensor1"], torch.arange(10)) 134 "tensor1": torch.arange(10, device=device), 146 tensor1 = cpu_state_dict["tensor1"] 147 cpu_state_dict["tensor1"] = torch.arange(11) 149 cpu_state_dict["tensor1"] = tensor1 157 self.assertEqual(cpu_state_dict["tensor1"], torch.arange(10))
|
/aosp_15_r20/external/libaom/av1/encoder/ |
H A D | cnn.c | 905 TENSOR tensor1[CNN_MAX_BRANCHES] = { { 0 } }; in av1_cnn_predict_c() local 919 init_tensor(&tensor1[b]); in av1_cnn_predict_c() 932 assign_tensor(&tensor1[branch], (float **)input, in av1_cnn_predict_c() 935 // Swap tensor1 and tensor2 in av1_cnn_predict_c() 936 swap_tensor(&tensor1[branch], &tensor2[branch]); in av1_cnn_predict_c() 938 i_width = tensor1[branch].width; in av1_cnn_predict_c() 939 i_height = tensor1[branch].height; in av1_cnn_predict_c() 964 if (!copy_active_tensor_to_branches(&tensor1[branch], layer_config, in av1_cnn_predict_c() 970 assert(tensor1[branch].channels == layer_config->in_channels); in av1_cnn_predict_c() 976 convolve_layer_mt((const float **)tensor1[branch].buf, in av1_cnn_predict_c() [all …]
|
/aosp_15_r20/system/media/audio_utils/tests/ |
H A D | audio_nnapi_tests.cpp | 59 * tensor1 ---+ | 133 * (tensor0 + tensor1) * (tensor2 + tensor3). 137 * tensor1 ---+ | 237 uint32_t tensor1 = opIdx++; in CreateModel() local 240 "ANeuralNetworksModel_addOperand failed for operand (%d)", tensor1); in CreateModel() 296 tensor1, in CreateModel() 338 // Inputs: {tensor0, tensor1, tensor2, tensor3} in CreateModel() 342 tensor1, in CreateModel() 451 * @param inputValue1 value to fill tensor1 494 // Set the values of the second input operand (tensor1) to be inputValue1. in Compute() [all …]
|
/aosp_15_r20/external/ComputeLibrary/tests/ |
H A D | SimpleTensor.h | 206 * @param[in, out] tensor1 Tensor to be swapped. 210 friend void swap(SimpleTensor<U> &tensor1, SimpleTensor<U> &tensor2); 442 void swap(SimpleTensor<U> &tensor1, SimpleTensor<U> &tensor2) in swap() argument 447 swap(tensor1._shape, tensor2._shape); in swap() 448 swap(tensor1._format, tensor2._format); in swap() 449 swap(tensor1._data_type, tensor2._data_type); in swap() 450 swap(tensor1._num_channels, tensor2._num_channels); in swap() 451 swap(tensor1._quantization_info, tensor2._quantization_info); in swap() 452 swap(tensor1._buffer, tensor2._buffer); in swap()
|
/aosp_15_r20/external/armnn/python/pyarmnn/test/ |
H A D | test_deserializer.py | 56 tensor1 = output_binding_info1[1] 58 assert tensor1.GetDataType() == 2 59 assert tensor1.GetNumDimensions() == 2 60 assert tensor1.GetNumElements() == 10 61 assert tensor1.GetQuantizationOffset() == 0 62 assert tensor1.GetQuantizationScale() == 0.00390625
|
H A D | test_tflite_parser.py | 106 tensor1 = output_binding_info1[1] 108 assert tensor1.GetDataType() == 2 109 assert tensor1.GetNumDimensions() == 2 110 assert tensor1.GetNumElements() == 10 111 assert tensor1.GetQuantizationOffset() == 0 112 assert tensor1.GetQuantizationScale() == 0.00390625
|
/aosp_15_r20/external/pytorch/test/distributed/tensor/parallel/ |
H A D | test_tp_random_state.py | 95 def tp_weights_assert(tensor1, tensor2): argument 98 self.assertNotEqual(tensor1, tensor2) 102 self.assertEqual(tensor1, tensor2) 117 def dp_weights_assert(tensor1, tensor2): argument 120 self.assertEqual(tensor1, tensor2) 125 self.assertNotEqual(tensor1, tensor2)
|