/external/tensorflow/tensorflow/lite/kernels/internal/ |
D | tensor_ctypes.h | 24 inline T* GetTensorData(TfLiteTensor* tensor); 27 inline float* GetTensorData(TfLiteTensor* tensor) { in GetTensorData() argument 28 return tensor != nullptr ? tensor->data.f : nullptr; in GetTensorData() 32 inline uint8_t* GetTensorData(TfLiteTensor* tensor) { in GetTensorData() argument 33 return tensor != nullptr ? tensor->data.uint8 : nullptr; in GetTensorData() 37 inline int16_t* GetTensorData(TfLiteTensor* tensor) { in GetTensorData() argument 38 return tensor != nullptr ? tensor->data.i16 : nullptr; in GetTensorData() 42 inline int32_t* GetTensorData(TfLiteTensor* tensor) { in GetTensorData() argument 43 return tensor != nullptr ? tensor->data.i32 : nullptr; in GetTensorData() 47 inline int64_t* GetTensorData(TfLiteTensor* tensor) { in GetTensorData() argument [all …]
|
/external/eigen/unsupported/test/ |
D | cxx11_tensor_argmax.cpp | 22 Tensor<float, 4, DataLayout> tensor(2,3,5,7); in test_simple_index_tuples() local 23 tensor.setRandom(); in test_simple_index_tuples() 24 tensor = (tensor + tensor.constant(0.5)).log(); in test_simple_index_tuples() 27 index_tuples = tensor.index_tuples(); in test_simple_index_tuples() 32 VERIFY_IS_EQUAL(v.second, tensor.coeff(n)); in test_simple_index_tuples() 39 Tensor<float, 4, DataLayout> tensor(2,3,5,7); in test_index_tuples_dim() local 40 tensor.setRandom(); in test_index_tuples_dim() 41 tensor = (tensor + tensor.constant(0.5)).log(); in test_index_tuples_dim() 45 index_tuples = tensor.index_tuples(); in test_index_tuples_dim() 47 for (Eigen::DenseIndex n = 0; n < tensor.size(); ++n) { in test_index_tuples_dim() [all …]
|
D | cxx11_tensor_chipping.cpp | 19 Tensor<float, 5, DataLayout> tensor(2,3,5,7,11); in test_simple_chip() local 20 tensor.setRandom(); in test_simple_chip() 23 chip1 = tensor.template chip<0>(1); in test_simple_chip() 34 VERIFY_IS_EQUAL(chip1(i,j,k,l), tensor(1,i,j,k,l)); in test_simple_chip() 40 Tensor<float, 4, DataLayout> chip2 = tensor.template chip<1>(1); in test_simple_chip() 49 VERIFY_IS_EQUAL(chip2(i,j,k,l), tensor(i,1,j,k,l)); in test_simple_chip() 55 Tensor<float, 4, DataLayout> chip3 = tensor.template chip<2>(2); in test_simple_chip() 64 VERIFY_IS_EQUAL(chip3(i,j,k,l), tensor(i,j,2,k,l)); in test_simple_chip() 70 Tensor<float, 4, DataLayout> chip4(tensor.template chip<3>(5)); in test_simple_chip() 79 VERIFY_IS_EQUAL(chip4(i,j,k,l), tensor(i,j,k,5,l)); in test_simple_chip() [all …]
|
D | cxx11_tensor_custom_index.cpp | 24 Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7); in test_map_as_index() local 25 tensor.setRandom(); in test_map_as_index() 36 VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor.coeff(coeff)); in test_map_as_index() 37 VERIFY_IS_EQUAL(tensor.coeffRef(coeffC), tensor.coeffRef(coeff)); in test_map_as_index() 46 Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7); in test_matrix_as_index() local 47 tensor.setRandom(); in test_matrix_as_index() 54 VERIFY_IS_EQUAL(tensor.coeff(coeffC), tensor.coeff(coeff)); in test_matrix_as_index() 55 VERIFY_IS_EQUAL(tensor.coeffRef(coeffC), tensor.coeffRef(coeff)); in test_matrix_as_index() 64 Tensor<float, 4, DataLayout> tensor(2, 3, 5, 7); in test_varlist_as_index() local 65 tensor.setRandom(); in test_varlist_as_index() [all …]
|
D | cxx11_tensor_reduction.cpp | 20 Tensor<float, 0, DataLayout> tensor; in test_trivial_reductions() local 21 tensor.setRandom(); in test_trivial_reductions() 24 Tensor<float, 0, DataLayout> result = tensor.sum(reduction_axis); in test_trivial_reductions() 25 VERIFY_IS_EQUAL(result(), tensor()); in test_trivial_reductions() 29 Tensor<float, 1, DataLayout> tensor(7); in test_trivial_reductions() local 30 tensor.setRandom(); in test_trivial_reductions() 33 Tensor<float, 1, DataLayout> result = tensor.sum(reduction_axis); in test_trivial_reductions() 36 VERIFY_IS_EQUAL(result(i), tensor(i)); in test_trivial_reductions() 41 Tensor<float, 2, DataLayout> tensor(2, 3); in test_trivial_reductions() local 42 tensor.setRandom(); in test_trivial_reductions() [all …]
|
D | cxx11_tensor_scan.cpp | 21 Tensor<Type, 1, DataLayout> tensor(size); in test_1d_scan() local 22 tensor.setRandom(); in test_1d_scan() 23 Tensor<Type, 1, DataLayout> result = tensor.cumsum(0, Exclusive); in test_1d_scan() 25 VERIFY_IS_EQUAL(tensor.dimension(0), result.dimension(0)); in test_1d_scan() 31 accum += tensor(i); in test_1d_scan() 33 accum += tensor(i); in test_1d_scan() 39 result = tensor.cumprod(0, Exclusive); in test_1d_scan() 43 accum *= tensor(i); in test_1d_scan() 45 accum *= tensor(i); in test_1d_scan() 55 Tensor<Type, 4, DataLayout> tensor(size, size, size, size); in test_4d_scan() local [all …]
|
D | cxx11_tensor_layout_swap.cpp | 18 Tensor<float, 3, ColMajor> tensor(2,3,7); in test_simple_swap() local 19 tensor.setRandom(); in test_simple_swap() 21 Tensor<float, 3, RowMajor> tensor2 = tensor.swap_layout(); in test_simple_swap() 22 VERIFY_IS_EQUAL(tensor.dimension(0), tensor2.dimension(2)); in test_simple_swap() 23 VERIFY_IS_EQUAL(tensor.dimension(1), tensor2.dimension(1)); in test_simple_swap() 24 VERIFY_IS_EQUAL(tensor.dimension(2), tensor2.dimension(0)); in test_simple_swap() 29 VERIFY_IS_EQUAL(tensor(i,j,k), tensor2(k,j,i)); in test_simple_swap() 38 Tensor<float, 3, ColMajor> tensor(2,3,7); in test_swap_as_lvalue() local 39 tensor.setRandom(); in test_swap_as_lvalue() 42 tensor2.swap_layout() = tensor; in test_swap_as_lvalue() [all …]
|
/external/tensorflow/tensorflow/lite/g3doc/guide/ |
D | ops_compatibility.md | 44 *as long as the input tensor is 4D (1 batch + 2 spatial + 1 other) and the 72 *as long as the input tensor is 4D (1 batch + 2 spatial + 1 other)* 76 0D tensor* 149 0: a tensor 160 0: a tensor 161 1: a tensor 186 0: a tensor 187 1: a tensor 190 0: A tensor of indices of maximum values. 198 0: a tensor [all …]
|
/external/tensorflow/tensorflow/lite/testing/ |
D | tflite_driver.cc | 83 bool Check(bool verbose, const TfLiteTensor& tensor); 87 bool TypedCheck(bool verbose, const TfLiteTensor& tensor) { in TypedCheck() argument 92 size_t tensor_size = tensor.bytes / sizeof(T); in TypedCheck() 97 std::cerr << "while checking tensor " << tensor.name << std::endl; in TypedCheck() 103 float computed = Value<T>(tensor.data, i); in TypedCheck() 138 const TfLiteTensor& tensor) { in TypedCheck() argument 139 if (tensor.data.raw == nullptr) { in TypedCheck() 146 int returned_num_strings = GetStringCount(tensor.data.raw); in TypedCheck() 156 auto returned_ref = GetString(tensor.data.raw, i); in TypedCheck() 177 const TfLiteTensor& tensor) { in Check() argument [all …]
|
D | tf_driver.cc | 39 int FillTensorWithData(tensorflow::Tensor* tensor, in FillTensorWithData() argument 43 if (values.size() == tensor->NumElements()) { in FillTensorWithData() 44 auto data = tensor->flat<T>(); in FillTensorWithData() 56 int FillTensorWithTfLiteHexString(tensorflow::Tensor* tensor, in FillTensorWithTfLiteHexString() argument 62 if (num_strings == tensor->NumElements()) { in FillTensorWithTfLiteHexString() 63 auto data = tensor->flat<string>(); in FillTensorWithTfLiteHexString() 74 void FillTensorWithZeros(tensorflow::Tensor* tensor) { in FillTensorWithZeros() argument 75 auto data = tensor->flat<T>(); in FillTensorWithZeros() 76 for (int i = 0; i < tensor->NumElements(); i++) { in FillTensorWithZeros() 82 string TensorDataToCsvString(const tensorflow::Tensor& tensor) { in TensorDataToCsvString() argument [all …]
|
/external/tensorflow/tensorflow/lite/testing/nnapi_tflite_zip_tests/ |
D | tflite_driver.cc | 85 bool Check(bool verbose, const TfLiteTensor& tensor); 89 bool TypedCheck(bool verbose, const TfLiteTensor& tensor) { in TypedCheck() argument 94 size_t tensor_size = tensor.bytes / sizeof(T); in TypedCheck() 99 std::cerr << "while checking tensor " << tensor.name << std::endl; in TypedCheck() 105 float computed = Value<T>(tensor.data, i); in TypedCheck() 138 const TfLiteTensor& tensor) { in TypedCheck() argument 139 if (tensor.data.raw == nullptr) { in TypedCheck() 146 int returned_num_strings = GetStringCount(tensor.data.raw); in TypedCheck() 156 auto returned_ref = GetString(tensor.data.raw, i); in TypedCheck() 177 const TfLiteTensor& tensor) { in Check() argument [all …]
|
/external/tensorflow/tensorflow/contrib/slim/python/slim/ |
D | summaries.py | 42 def _get_summary_name(tensor, name=None, prefix=None, postfix=None): argument 55 name = tensor.op.name 63 def add_histogram_summary(tensor, name=None, prefix=None): argument 76 _get_summary_name(tensor, name, prefix), tensor) 79 def add_image_summary(tensor, name=None, prefix=None, print_summary=False): argument 93 summary_name = _get_summary_name(tensor, name, prefix) 98 name=summary_name, tensor=tensor, collections=collections) 100 op = logging_ops.Print(op, [tensor], summary_name) 105 def add_scalar_summary(tensor, name=None, prefix=None, print_summary=False): argument 120 summary_name = _get_summary_name(tensor, name, prefix) [all …]
|
/external/tensorflow/tensorflow/python/framework/ |
D | subscribe.py | 105 def _subscribe_new(tensor, side_effects, control_cache): argument 117 for consumer_op in list(tensor.consumers()): # explicit copy 118 update_input.append((consumer_op, list(consumer_op.inputs).index(tensor))) 120 update_control_input = control_cache.get_control_outputs(tensor.op) 123 name_scope = tensor.op.name + '/subscription/' 127 outs += s(tensor) 130 out = array_ops.identity(tensor) 141 if tensor.op in new_control_inputs: 142 new_control_inputs.remove(tensor.op) 151 def _subscribe_extend(tensor, side_effects): argument [all …]
|
D | tensor_util.py | 581 def MakeNdarray(tensor): argument 596 shape = [d.size for d in tensor.tensor_shape.dim] 598 tensor_dtype = dtypes.as_dtype(tensor.dtype) 601 if tensor.tensor_content: 602 return (np.frombuffer(tensor.tensor_content, 607 values = list(tensor.string_val) 617 values = np.fromiter(tensor.half_val, dtype=np.uint16) 620 values = np.fromiter(tensor.float_val, dtype=dtype) 622 values = np.fromiter(tensor.double_val, dtype=dtype) 627 values = np.fromiter(tensor.int_val, dtype=dtype) [all …]
|
/external/tensorflow/tensorflow/core/framework/ |
D | tensor_util.cc | 30 namespace tensor { namespace 59 for (const Tensor& tensor : tensors) { in Concat() local 60 if (tensor.dims() == 0) { in Concat() 64 total_dim0_size += tensor.dim_size(0); in Concat() 85 for (const Tensor& tensor : tensors) { in Concat() local 86 StringPiece from_data = tensor.tensor_data(); in Concat() 101 for (const Tensor& tensor : tensors) { in Concat() local 102 auto from_strings = tensor.flat<string>(); in Concat() 103 CHECK_LE(offset + tensor.NumElements(), result->NumElements()); in Concat() 104 for (int i = 0; i < tensor.NumElements(); ++i) { in Concat() [all …]
|
D | tensor_util_test.cc | 36 Tensor y = tensor::DeepCopy(x); in TEST() 48 Tensor z = tensor::DeepCopy(y); in TEST() 70 Tensor y = tensor::DeepCopy(x); in TEST() 81 Tensor y = tensor::DeepCopy(x); in TEST() 93 Tensor z = tensor::DeepCopy(y); in TEST() 116 Tensor str2 = tensor::DeepCopy(str1); in TEST() 130 Tensor z = tensor::DeepCopy(y); in TEST() 160 Tensor z = tensor::DeepCopy(y); in TEST() 190 Tensor z = tensor::DeepCopy(y); in TEST() 221 Tensor tensor(DT_INT32, TensorShape({size, 2})); in TEST() local [all …]
|
/external/tensorflow/tensorflow/lite/python/interpreter_wrapper/ |
D | interpreter_wrapper.cc | 191 const TfLiteTensor* tensor = interpreter_->tensor(i); in TensorName() local 192 return tensor->name ? tensor->name : ""; in TensorName() 199 const TfLiteTensor* tensor = interpreter_->tensor(i); in TensorType() local 200 if (tensor->type == kTfLiteNoType) { in TensorType() 205 int code = python_utils::TfLiteTypeToPyArrayType(tensor->type); in TensorType() 217 const TfLiteTensor* tensor = interpreter_->tensor(i); in TensorSize() local 218 if (tensor->dims == nullptr) { in TensorSize() 223 PyArrayFromIntVector(tensor->dims->data, tensor->dims->size); in TensorSize() 231 const TfLiteTensor* tensor = interpreter_->tensor(i); in TensorQuantization() local 232 return PyTupleFromQuantizationParam(tensor->params); in TensorQuantization() [all …]
|
/external/tensorflow/tensorflow/python/kernel_tests/ |
D | string_format_op_test.py | 38 tensor = math_ops.range(10) 39 format_output = string_ops.string_format("{}", tensor) 45 tensor = math_ops.range(10) 46 format_output = string_ops.string_format("{}", [tensor]) 90 tensor = constant_op.constant([0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7]) 91 format_output = string_ops.string_format("{}", tensor) 99 tensor = math_ops.range(6) 100 format_output = string_ops.string_format("{}", tensor, summarize=3) 108 tensor = math_ops.range(6) 109 format_output = string_ops.string_format("{}", tensor, summarize=-1) [all …]
|
/external/tensorflow/tensorflow/lite/java/src/main/native/ |
D | tensor_jni.cc | 37 TfLiteTensor* tensor() const { return interpreter_->tensor(tensor_index_); } in tensor() function in __anon5dfcb4930111::TensorHandle 51 return reinterpret_cast<TensorHandle*>(handle)->tensor(); in GetTensorFromHandle() 205 int ReadMultiDimensionalStringArray(JNIEnv* env, TfLiteTensor* tensor, in ReadMultiDimensionalStringArray() argument 217 tflite::GetString(tensor, start_str_index + num_strings_read); in ReadMultiDimensionalStringArray() 228 env, tensor, dims_left - 1, start_str_index + num_strings_read, row); in ReadMultiDimensionalStringArray() 287 TfLiteTensor* tensor) { in WriteMultiDimensionalStringArray() argument 289 PopulateStringDynamicBuffer(env, src, &dst_buffer, tensor->dims->size); in WriteMultiDimensionalStringArray() 291 dst_buffer.WriteToTensor(tensor, /*new_shape=*/nullptr); in WriteMultiDimensionalStringArray() 313 TfLiteTensor* tensor = GetTensorFromHandle(env, handle); in Java_org_tensorflow_lite_Tensor_buffer() local 314 if (tensor == nullptr) return nullptr; in Java_org_tensorflow_lite_Tensor_buffer() [all …]
|
/external/tensorflow/tensorflow/lite/tools/ |
D | verifier.cc | 57 bool VerifyStringTensorBuffer(const Tensor& tensor, const Buffer& buffer, in VerifyStringTensorBuffer() argument 66 tensor.name()->c_str(), num_strings); in VerifyStringTensorBuffer() 76 tensor.name()->c_str(), header_offsets, buffer_size); in VerifyStringTensorBuffer() 86 tensor.name()->c_str(), header_offsets); in VerifyStringTensorBuffer() 95 tensor.name()->c_str(), i); in VerifyStringTensorBuffer() 102 tensor.name()->c_str(), buffer_size); in VerifyStringTensorBuffer() 109 bool VerifyNumericTensorBuffer(const Tensor& tensor, const Buffer& buffer, in VerifyNumericTensorBuffer() argument 112 if (!tensor.shape()) { in VerifyNumericTensorBuffer() 116 for (int dim : *tensor.shape()) { in VerifyNumericTensorBuffer() 120 tensor.name()->c_str()); in VerifyNumericTensorBuffer() [all …]
|
/external/tensorflow/tensorflow/lite/tools/accuracy/ilsvrc/ |
D | imagenet_topk_eval_test.cc | 26 Tensor tensor(DT_STRING, TensorShape({})); in CreateStringTensor() local 27 tensor.scalar<string>()() = value; in CreateStringTensor() 28 return tensor; in CreateStringTensor() 32 Tensor tensor(DT_FLOAT, TensorShape({1, kNumCategories})); in CreateOutputTensor() local 34 tensor.flat<float>()(i) = 0; in CreateOutputTensor() 36 return tensor; in CreateOutputTensor() 60 Tensor tensor = CreateOutputTensor(); in TEST() local 61 tensor.flat<float>()(0) = 0.8; in TEST() 63 TF_CHECK_OK(acc_top_5.ComputeEval({tensor}, CreateStringTensor("0"))); in TEST() 70 tensor.flat<float>()(1) = 0.9; in TEST() [all …]
|
/external/tensorflow/tensorflow/compiler/xla/experimental/xla_sharding/ |
D | xla_sharding.py | 92 def split(cls, tensor, split_dimension, num_devices): argument 107 shape = tensor.shape.as_list() 123 def apply_to_tensor(self, tensor): argument 125 if len(tensor.op.outputs) > 1: 126 proto = self._get_or_create_tuple_proto(tensor.op) 130 tuple_shardings[tensor.value_index] = self._proto 139 tensor.op._set_attr('_XlaSharding', attr_value) 169 def replicate(tensor): argument 170 Sharding.replicate().apply_to_tensor(tensor) 171 return tensor [all …]
|
/external/tensorflow/tensorflow/lite/delegates/flex/ |
D | buffer_map.cc | 65 explicit TfLiteTensorBuffer(const TfLiteTensor* tensor) in TfLiteTensorBuffer() argument 67 EIGEN_MAX_ALIGN_BYTES, tensor->bytes)) { in TfLiteTensorBuffer() 71 len_ = tensor->bytes; in TfLiteTensorBuffer() 76 std::memcpy(data(), tensor->data.raw, tensor->bytes); in TfLiteTensorBuffer() 95 explicit StringTfLiteTensorBuffer(const TfLiteTensor* tensor) in StringTfLiteTensorBuffer() argument 96 : StringTfLiteTensorBuffer(tensor, tensor->data.raw != nullptr in StringTfLiteTensorBuffer() 97 ? GetStringCount(tensor->data.raw) in StringTfLiteTensorBuffer() 109 StringTfLiteTensorBuffer(const TfLiteTensor* tensor, int num_strings) in StringTfLiteTensorBuffer() argument 120 auto ref = GetString(tensor->data.raw, i); in StringTfLiteTensorBuffer() 147 void BufferMap::SetFromTfLite(int tensor_index, const TfLiteTensor* tensor) { in SetFromTfLite() argument [all …]
|
/external/tensorflow/tensorflow/lite/toco/ |
D | tensorflow_util.cc | 110 const auto& tensor = attr.second.tensor(); in LogDumpGraphDef() local 113 tensorflow::DataType_Name(tensor.dtype())); in LogDumpGraphDef() 114 const auto& shape = tensor.tensor_shape(); in LogDumpGraphDef() 120 if (!tensor.tensor_content().empty()) { in LogDumpGraphDef() 122 tensor.tensor_content().size()); in LogDumpGraphDef() 124 if (tensor.dtype() == tensorflow::DT_INT32) { in LogDumpGraphDef() 125 CHECK_EQ(0, tensor.tensor_content().size() % sizeof(int32)); in LogDumpGraphDef() 126 const int size = tensor.tensor_content().size() / sizeof(int32); in LogDumpGraphDef() 128 toco::port::CopyToBuffer(tensor.tensor_content(), in LogDumpGraphDef() 140 if (tensor.dtype() == tensorflow::DT_FLOAT) { in LogDumpGraphDef() [all …]
|
/external/tensorflow/tensorflow/python/debug/cli/ |
D | tensor_format.py | 72 def format_tensor(tensor, argument 122 if isinstance(tensor, debug_data.InconvertibleTensorProto): 125 lines.extend(str(tensor).split("\n")) 127 elif not isinstance(tensor, np.ndarray): 132 lines.extend(repr(tensor).split("\n")) 136 lines.append(" dtype: %s" % str(tensor.dtype)) 137 lines.append(" shape: %s" % str(tensor.shape).replace("L", "")) 149 formatted.extend(numeric_summary(tensor)) 156 array_lines = repr(tensor).split("\n") 157 if tensor.dtype.type is not np.string_: [all …]
|