Home
last modified time | relevance | path

Searched refs:input_array (Results 1 – 25 of 76) sorted by relevance

1234

/external/tensorflow/tensorflow/lite/toco/graph_transformations/
Dmake_initial_dequantize_operator.cc55 auto& input_array = model->GetArray(input_name); in AddDequantizeOperatorToInput() local
56 if (input_array.data_type != ArrayDataType::kFloat) { in AddDequantizeOperatorToInput()
60 if (input_array.final_data_type == input_array.data_type || in AddDequantizeOperatorToInput()
61 input_array.final_data_type == ArrayDataType::kNone) { in AddDequantizeOperatorToInput()
83 const auto& input_minmax = input_array.GetMinMax(); in AddDequantizeOperatorToInput()
86 auto& input_qparams = input_array.GetOrCreateQuantizationParams(); in AddDequantizeOperatorToInput()
87 input_array.data_type = input_array.final_data_type; in AddDequantizeOperatorToInput()
89 input_array, input_array.data_type, &input_qparams); in AddDequantizeOperatorToInput()
110 for (auto& input_array : *model->flags.mutable_input_arrays()) { in Run()
111 if (input_array.name() == input) { in Run()
[all …]
Dresolve_constant_reshape.cc55 const Array& input_array = model->GetArray(op->inputs[0]); in Run() local
56 if (!ShapesAgreeUpToExtending(input_array.shape(), output_array.shape())) { in Run()
58 ShapeToString(input_array.shape()), in Run()
64 switch (input_array.data_type) { in Run()
66 CopyArrayBuffer<ArrayDataType::kBool>(input_array, &output_array); in Run()
69 CopyArrayBuffer<ArrayDataType::kFloat>(input_array, &output_array); in Run()
72 CopyArrayBuffer<ArrayDataType::kInt8>(input_array, &output_array); in Run()
75 CopyArrayBuffer<ArrayDataType::kUint8>(input_array, &output_array); in Run()
78 CopyArrayBuffer<ArrayDataType::kInt16>(input_array, &output_array); in Run()
81 CopyArrayBuffer<ArrayDataType::kUint16>(input_array, &output_array); in Run()
[all …]
Dpropagate_fixed_sizes.cc125 const auto& input_array = model->GetArray(op->inputs[0]); in ProcessConvOperator() local
127 if (!input_array.has_shape()) { in ProcessConvOperator()
130 const auto& input_shape = input_array.shape(); in ProcessConvOperator()
223 const auto& input_array = in ProcessTransposeConvOperator() local
225 if (!input_array.has_shape()) { in ProcessTransposeConvOperator()
229 const auto& input_shape = input_array.shape(); in ProcessTransposeConvOperator()
254 const auto& input_array = model->GetArray(op->inputs[0]); in ProcessDepthwiseConvOperator() local
256 if (!input_array.has_shape()) { in ProcessDepthwiseConvOperator()
259 const auto& input_shape = input_array.shape(); in ProcessDepthwiseConvOperator()
296 const auto& input_array = model->GetArray(op->inputs[0]); in ProcessDepthToSpaceOperator() local
[all …]
Dresolve_reorder_axes.cc58 const Array& input_array, Array* output_array) { in ReorderAxes() argument
59 DCHECK(input_array.buffer->type == DataType); in ReorderAxes()
61 const auto& input_data = input_array.GetBuffer<DataType>().data; in ReorderAxes()
65 Shape input_shape = input_array.shape(); in ReorderAxes()
73 if (input_array.minmax) { in ReorderAxes()
74 output_array->GetOrCreateMinMax() = input_array.GetMinMax(); in ReorderAxes()
76 if (input_array.narrow_range) { in ReorderAxes()
95 auto& input_array = model->GetArray(input_array_name); in Run() local
97 if (!input_array.buffer) { in Run()
105 if (input_array.buffer->type == ArrayDataType::kFloat) { in Run()
[all …]
Dresolve_constant_strided_slice.cc28 void StridedSlice(StridedSliceOperator const& op, Array const& input_array, in StridedSlice() argument
35 CHECK(input_array.data_type == Type); in StridedSlice()
51 Shape const& input_shape = input_array.shape(); in StridedSlice()
52 Buffer<Type> const& input_buffer = input_array.GetBuffer<Type>(); in StridedSlice()
62 strided_slice_params, ToRuntimeShape(input_array.shape()), axis); in StridedSlice()
65 strided_slice_params, ToRuntimeShape(input_array.shape()), axis, in StridedSlice()
132 const auto& input_array = model->GetArray(op->inputs[0]); in Run() local
133 if (!input_array.has_shape()) { in Run()
145 StridedSlice<ArrayDataType::kFloat>(*op, input_array, &output_array); in Run()
148 StridedSlice<ArrayDataType::kUint8>(*op, input_array, &output_array); in Run()
[all …]
Dresolve_constant_tile.cc72 inline void Tile(const Array& input_array, const Array& multiples_array, in Tile() argument
81 input_array.shape(), input_array.GetBuffer<Type>().data.data(), in Tile()
87 input_array.shape(), input_array.GetBuffer<Type>().data.data(), in Tile()
128 const Array& input_array = model->GetArray(op->inputs[0]); in Run() local
134 CopyMinMaxAndQuantizationRelatedFields(input_array, &output_array); in Run()
139 Tile<ArrayDataType::kFloat>(input_array, multiples_array, &output_array); in Run()
142 Tile<ArrayDataType::kUint8>(input_array, multiples_array, &output_array); in Run()
145 Tile<ArrayDataType::kInt16>(input_array, multiples_array, &output_array); in Run()
148 Tile<ArrayDataType::kInt32>(input_array, multiples_array, &output_array); in Run()
151 Tile<ArrayDataType::kInt64>(input_array, multiples_array, &output_array); in Run()
[all …]
Dresolve_constant_slice.cc27 bool Slice(SliceOperator const& op, Array const& input_array, in Slice() argument
31 CHECK(input_array.data_type == Type); in Slice()
33 const auto& input_data = input_array.GetBuffer<Type>().data; in Slice()
57 dim_size = input_array.shape().dims()[i] - begin[i]; in Slice()
66 Shape padded_shape = input_array.shape(); in Slice()
118 const auto& input_array = model->GetArray(op->inputs[0]); in Run() local
119 if (!input_array.has_shape()) { in Run()
131 if (!Slice<ArrayDataType::kFloat>(*op, input_array, &output_array)) { in Run()
136 if (!Slice<ArrayDataType::kUint8>(*op, input_array, &output_array)) { in Run()
141 if (!Slice<ArrayDataType::kInt32>(*op, input_array, &output_array)) { in Run()
[all …]
Ddequantize.cc58 for (auto& input_array : *model->flags.mutable_input_arrays()) { in ClearArrayQuantizationParams()
59 if (input_array.name() == array_name) { in ClearArrayQuantizationParams()
63 if (input_array.has_std_value()) { in ClearArrayQuantizationParams()
64 CHECK_LE(std::abs(new_std_value - input_array.std_value()), 0.001); in ClearArrayQuantizationParams()
66 input_array.set_std_value(new_std_value); in ClearArrayQuantizationParams()
68 if (input_array.has_mean_value()) { in ClearArrayQuantizationParams()
69 CHECK_LE(std::abs(new_mean_value - input_array.mean_value()), 0.001); in ClearArrayQuantizationParams()
71 input_array.set_mean_value(new_mean_value); in ClearArrayQuantizationParams()
196 auto& input_array = model->GetArray(op->inputs[0]); in Run() local
197 if (input_array.data_type == ArrayDataType::kFloat) { in Run()
[all …]
Dresolve_constant_gather.cc28 inline void Gather(const Array& input_array, const Array& coords_array, in Gather() argument
30 const Shape& input_shape = input_array.shape(); in Gather()
32 input_array.GetBuffer<Type>().data; in Gather()
106 const Array& input_array = model->GetArray(op->inputs[0]); in Run() local
114 if (input_array.minmax) { in Run()
115 const auto& input_minmax = input_array.GetMinMax(); in Run()
124 Gather<ArrayDataType::kFloat>(input_array, coords_array, &output_array); in Run()
127 Gather<ArrayDataType::kUint8>(input_array, coords_array, &output_array); in Run()
130 Gather<ArrayDataType::kInt32>(input_array, coords_array, &output_array); in Run()
133 Gather<ArrayDataType::kInt64>(input_array, coords_array, &output_array); in Run()
[all …]
Dresolve_constant_unary.cc103 const auto& input_array = model->GetArray(op.inputs[0]); in CopyMinMaxFromFirstInput() local
104 if (!input_array.minmax) { in CopyMinMaxFromFirstInput()
107 const auto& input_minmax = input_array.GetMinMax(); in CopyMinMaxFromFirstInput()
181 const auto& input_array = model->GetArray(unary_op->inputs[0]); in Run() local
184 CHECK(input_array.buffer); in Run()
195 if (cast_op->src_data_type != input_array.buffer->type) { in Run()
202 if (input_array.buffer->type != ArrayDataType::kFloat) { in Run()
205 input_float_data = &(input_array.GetBuffer<ArrayDataType::kFloat>().data); in Run()
216 const Shape& input_shape = input_array.shape(); in Run()
221 if (input_array.buffer->type == ArrayDataType::kFloat) { in Run()
[all …]
Dshuffle_fc_weights.cc39 const Array& input_array = model->GetArray(fc_op->inputs[0]); in Run() local
46 if (input_array.data_type != ArrayDataType::kUint8 || in Run()
49 !input_array.quantization_params || !weights_array.quantization_params || in Run()
54 if (!input_array.has_shape() || !weights_array.has_shape()) { in Run()
59 const Shape& input_shape = input_array.shape(); in Run()
151 shuffled_input_workspace_array.data_type = input_array.data_type; in Run()
152 *shuffled_input_workspace_array.mutable_shape() = input_array.shape(); in Run()
153 shuffled_input_workspace_array.GetOrCreateMinMax() = input_array.GetMinMax(); in Run()
155 input_array.GetQuantizationParams(); in Run()
Dresolve_constant_transpose.cc29 void Transpose(Model* model, const Array& input_array, in Transpose() argument
31 const Shape& input_shape = input_array.shape(); in Transpose()
33 input_array.GetBuffer<Type>().data; in Transpose()
132 const Array& input_array = model->GetArray(op->inputs[0]); in Run() local
134 CopyMinMaxAndQuantizationRelatedFields(input_array, &output_array); in Run()
147 Transpose<ArrayDataType::kFloat>(model, input_array, op->perm, in Run()
151 Transpose<ArrayDataType::kUint8>(model, input_array, op->perm, in Run()
155 Transpose<ArrayDataType::kInt32>(model, input_array, op->perm, in Run()
159 Transpose<ArrayDataType::kInt64>(model, input_array, op->perm, in Run()
163 Transpose<ArrayDataType::kComplex64>(model, input_array, op->perm, in Run()
Dhardcode_min_max.cc37 const auto& input_array = model->GetArray(op->inputs[0]); in HardcodeMinMaxForIm2colArray() local
38 if (!input_array.minmax) { in HardcodeMinMaxForIm2colArray()
41 const auto& input_minmax = input_array.GetMinMax(); in HardcodeMinMaxForIm2colArray()
54 const auto& input_array = model->GetArray(op->inputs[0]); in HardcodeMinMaxForL2Normalization() local
55 if (!input_array.minmax) { in HardcodeMinMaxForL2Normalization()
58 const auto& input_minmax = input_array.GetMinMax(); in HardcodeMinMaxForL2Normalization()
156 auto& input_array = model->GetArray(op->inputs[1]); in HardcodeMinMaxForSplit() local
157 if (!input_array.minmax) { in HardcodeMinMaxForSplit()
163 if (!array.minmax || !(array.GetMinMax() == input_array.GetMinMax())) { in HardcodeMinMaxForSplit()
165 array.GetOrCreateMinMax() = *input_array.minmax; in HardcodeMinMaxForSplit()
[all …]
Dresolve_constant_concatenation.cc40 for (Array* input_array : input_arrays) { in CopyTensorSegments()
41 if (!input_array->buffer) { in CopyTensorSegments()
60 for (Array* input_array : input_arrays) { in CopyTensorSegments()
61 src_ptr.push_back(input_array->GetBuffer<A>().data.data()); in CopyTensorSegments()
90 for (Array* input_array : input_arrays) { in ConcatenateTensorBuffers()
91 const Shape array_shape = input_array->shape(); in ConcatenateTensorBuffers()
119 for (Array* input_array : input_arrays) { in SetMinMaxForConcatenedArray()
122 if (!input_array->minmax) return; in SetMinMaxForConcatenedArray()
123 const MinMax& input_minmax = input_array->GetMinMax(); in SetMinMaxForConcatenedArray()
Dpropagate_default_min_max.cc52 auto& input_array = model->GetArray(input); in Run() local
53 if (!input_array.minmax && !input_array.buffer && in Run()
54 SupportsMinMax(input_array)) { in Run()
55 did_change |= SetArrayMinMax(input, &input_array); in Run()
Dconvert_trivial_pack_to_reshape.cc43 const auto& input_array = model->GetArray(pack_op->inputs[0]); in Run() local
44 if (!input_array.has_shape()) { in Run()
48 if (input_array.shape().dimensions_count() == 0) { in Run()
66 1 + input_array.shape().dimensions_count()}; in Run()
71 for (int dim : input_array.shape().dims()) { in Run()
Dresolve_constant_shape_or_rank.cc39 const auto& input_array = model->GetArray(op->inputs[0]); in Run() local
40 if (!input_array.has_shape()) { in Run()
55 output_buffer.data = input_array.shape().dims(); in Run()
59 output_buffer.data[0] = input_array.shape().dimensions_count(); in Run()
/external/tensorflow/tensorflow/compiler/xla/tests/
Dconvolution_variants_test.cc57 const Array4D<float> input_array(1, 1, 1, 1, {2}); in XLA_TEST_F() local
58 auto input = ConstantR4FromArray4D<float>(&builder, input_array); in XLA_TEST_F()
72 const Array4D<float> input_array(5, 1, 1, 1, {1, 2, 3, 4, 5}); in XLA_TEST_F() local
73 auto input = ConstantR4FromArray4D<float>(&builder, input_array); in XLA_TEST_F()
87 Array4D<float> input_array(2, 1, 3, 4); in XLA_TEST_F() local
88 input_array.FillWithMultiples(1); in XLA_TEST_F()
89 auto input = ConstantR4FromArray4D<float>(&builder, input_array); in XLA_TEST_F()
104 Array4D<float> input_array(1, 2, 1, 1, {10, 1}); in XLA_TEST_F() local
105 auto input = ConstantR4FromArray4D<float>(&builder, input_array); in XLA_TEST_F()
119 Array4D<float> input_array(1, 1, 1, 2, {1, 2}); in XLA_TEST_F() local
[all …]
Dreduce_window_test.cc156 Array4D<float> input_array(1, 0, 2, 1); in XLA_TEST_P() local
157 const auto input = CreateConstantFromArray(input_array, &builder_); in XLA_TEST_P()
161 auto res = ReferenceUtil::ReduceWindow4DAdd(input_array, 0.0f, {1, 1, 2, 1}, in XLA_TEST_P()
169 Array4D<float> input_array(1, 2, 2, 1); in TEST_P() local
170 input_array.FillRandom(2.f, 2.f); in TEST_P()
171 const auto input = CreateConstantFromArray(input_array, &builder_); in TEST_P()
176 auto res = ReferenceUtil::ReduceWindow4DAdd(input_array, 0.0f, {1, 1, 2, 1}, in TEST_P()
184 Array4D<float> input_array(1, 3, 3, 1); in TEST_P() local
185 input_array.FillRandom(2.f, 2.f); in TEST_P()
186 const auto input = CreateConstantFromArray(input_array, &builder_); in TEST_P()
[all …]
Dconstants_test.cc138 Array4D<float> input_array(3, 2, 1, 1); in TEST_F() local
145 input_array.FillWithPZ(pz); in TEST_F()
146 Literal input_literal = LiteralUtil::CreateR4FromArray4D(input_array); in TEST_F()
151 ComputeAndCompareR4<float>(&builder, input_array, {}, error_spec_); in TEST_F()
156 ConstantR4FromArray4D<float>(&builder, input_array); in TEST_F()
157 ComputeAndCompareR4<float>(&builder, input_array, {}, error_spec_); in TEST_F()
/external/tensorflow/tensorflow/python/kernel_tests/
Dreduce_join_op_test.py101 input_array, argument
119 inputs=input_array,
128 def _testMultipleReduceJoin(self, input_array, axis, separator=" "): argument
142 inputs=input_array, axis=axis, keep_dims=False, separator=separator)
144 inputs=input_array, axis=axis, keep_dims=True, separator=separator)
146 truth = input_array
163 input_array = ["this", "is", "a", "test"]
166 self._testReduceJoin(input_array, truth, truth_shape, axis=0)
169 input_array = [["this", "is", "a", "test"],
176 input_array, truth_dim_zero, truth_shape_dim_zero, axis=0)
[all …]
/external/tensorflow/tensorflow/lite/toco/tflite/
Doperator.cc68 const Array& input_array = op_signature.model->GetArray(input_name); in GetVersion() local
69 if (input_array.data_type == ArrayDataType::kInt8) { in GetVersion()
109 const Array& input_array = op_signature.model->GetArray(input_name); in GetVersion() local
113 if (input_array.data_type == ArrayDataType::kInt8 && in GetVersion()
120 if (input_array.data_type == ArrayDataType::kFloat && in GetVersion()
166 const Array& input_array = op_signature.model->GetArray(input_name); in GetVersion() local
170 if (input_array.data_type == ArrayDataType::kInt8 && in GetVersion()
204 const Array& input_array = op_signature.model->GetArray(input_name); in GetVersion() local
206 if (input_array.data_type == ArrayDataType::kInt8) { in GetVersion()
250 const Array& input_array = op_signature.model->GetArray(input_name); in GetVersion() local
[all …]
/external/tensorflow/tensorflow/lite/python/
Dconvert.py350 input_array = model.input_arrays.add()
351 input_array.name = tensor_name(input_tensor)
352 input_array.data_type = convert_dtype_to_tflite_type(input_tensor.dtype)
358 input_array.mean_value, input_array.std_value = quantized_input_stats[idx]
363 input_array.shape.dims.extend(map(int, shape))
405 input_array = model_flags.input_arrays.add()
411 input_array.mean_value, input_array.std_value = kwargs[
413 input_array.name = name
414 input_array.shape.dims.extend(map(int, shape))
/external/tensorflow/tensorflow/compiler/tests/
Dspacetobatch_op_test.py30 def space_to_batch_direct(input_array, block_shape, paddings): argument
43 input_array = np.array(input_array)
48 padded = np.pad(input_array,
50 (input_array.ndim - 1 - num_block_dims)),
52 reshaped_padded_shape = [input_array.shape[0]]
53 output_shape = [input_array.shape[0] * np.prod(block_shape)]
59 reshaped_padded_shape.extend(input_array.shape[num_block_dims + 1:])
60 output_shape.extend(input_array.shape[num_block_dims + 1:])
66 np.arange(input_array.ndim - num_block_dims - 1) + 1 + num_block_dims
/external/tensorflow/tensorflow/core/kernels/
Dquantize_down_and_shrink_range.cc53 auto input_array = input.flat<T1>(); in Compute() local
60 for (int i = 0; i < input_array.size(); ++i) { in Compute()
61 const T1 value = input_array(i); in Compute()
76 RequantizeManyInNewRange<T1, T2>(input_array.data(), input_array.size(), in Compute()
82 if (input_array.size() > 0) { in Compute()

1234