/external/tensorflow/tensorflow/contrib/lite/toco/tflite/ |
D | types.cc | 22 template <ArrayDataType T> 32 template <ArrayDataType T> 48 ::tflite::TensorType DataType::Serialize(ArrayDataType array_data_type) { in Serialize() 50 case ArrayDataType::kFloat: in Serialize() 52 case ArrayDataType::kInt32: in Serialize() 54 case ArrayDataType::kInt64: in Serialize() 56 case ArrayDataType::kUint8: in Serialize() 58 case ArrayDataType::kString: in Serialize() 67 ArrayDataType DataType::Deserialize(int tensor_type) { in Deserialize() 70 return ArrayDataType::kFloat; in Deserialize() [all …]
|
D | types_test.cc | 31 static const ArrayDataType kUnsupportedTocoTypes[] = {ArrayDataType::kNone, 32 ArrayDataType::kBool}; 43 template <ArrayDataType T> 70 std::vector<std::pair<ArrayDataType, ::tflite::TensorType>> testdata = { in TEST() 71 {ArrayDataType::kUint8, ::tflite::TensorType_UINT8}, in TEST() 72 {ArrayDataType::kInt32, ::tflite::TensorType_INT32}, in TEST() 73 {ArrayDataType::kInt64, ::tflite::TensorType_INT64}, in TEST() 74 {ArrayDataType::kFloat, ::tflite::TensorType_FLOAT32}}; in TEST() 87 for (ArrayDataType t : kUnsupportedTocoTypes) { in TEST() 111 for (ArrayDataType t : kUnsupportedTocoTypes) { in TEST() [all …]
|
/external/tensorflow/tensorflow/contrib/lite/toco/graph_transformations/ |
D | resolve_multiply_by_zero.cc | 39 template <ArrayDataType Type> 94 case ArrayDataType::kFloat: { in Run() 96 constant_input_array.GetBuffer<ArrayDataType::kFloat>().data; in Run() 97 if (!AreAllBufferElementsZero<DataType<ArrayDataType::kFloat>>( in Run() 101 FillArrayWithZeros<ArrayDataType::kFloat>(&output_array); in Run() 103 case ArrayDataType::kUint8: { in Run() 105 constant_input_array.GetBuffer<ArrayDataType::kUint8>().data; in Run() 106 if (!AreAllBufferElementsZero<DataType<ArrayDataType::kUint8>>( in Run() 110 FillArrayWithZeros<ArrayDataType::kUint8>(&output_array); in Run() 112 case ArrayDataType::kInt32: { in Run() [all …]
|
D | quantize.cc | 55 template <ArrayDataType A> 60 CHECK(buffer.type == ArrayDataType::kFloat); in QuantizeBuffer() 62 static_cast<const Buffer<ArrayDataType::kFloat>&>(buffer); in QuantizeBuffer() 85 template <ArrayDataType A> 90 CHECK(array.data_type == ArrayDataType::kFloat); in QuantizeArray() 101 const string& name, ArrayDataType quantized_data_type, in QuantizeArray() 104 case ArrayDataType::kUint8: in QuantizeArray() 105 return QuantizeArray<ArrayDataType::kUint8>(transformation, model, name, in QuantizeArray() 107 case ArrayDataType::kInt16: in QuantizeArray() 108 return QuantizeArray<ArrayDataType::kInt16>(transformation, model, name, in QuantizeArray() [all …]
|
D | resolve_constant_stack.cc | 26 template <ArrayDataType Type> 63 if (output_array.data_type == ArrayDataType::kNone) { in Run() 82 case ArrayDataType::kFloat: in Run() 83 Stack<ArrayDataType::kFloat>(model, *op); in Run() 85 case ArrayDataType::kUint8: in Run() 86 Stack<ArrayDataType::kUint8>(model, *op); in Run() 88 case ArrayDataType::kInt32: in Run() 89 Stack<ArrayDataType::kInt32>(model, *op); in Run() 91 case ArrayDataType::kInt64: in Run() 92 Stack<ArrayDataType::kInt64>(model, *op); in Run()
|
D | dequantize.cc | 30 template <ArrayDataType A> 34 array->data_type = ArrayDataType::kFloat; in DequantizeBuffer() 35 auto& new_data = array->GetMutableBuffer<ArrayDataType::kFloat>().data; in DequantizeBuffer() 88 if (array->data_type == ArrayDataType::kUint8) { in DequantizeArray() 89 DequantizeBuffer<ArrayDataType::kUint8>(array); in DequantizeArray() 90 } else if (array->data_type == ArrayDataType::kInt32) { in DequantizeArray() 91 DequantizeBuffer<ArrayDataType::kInt32>(array); in DequantizeArray() 95 CHECK(array->data_type == ArrayDataType::kFloat); in DequantizeArray() 96 CHECK(array->buffer->type == ArrayDataType::kFloat); in DequantizeArray() 102 array->data_type = ArrayDataType::kFloat; in DequantizeArray() [all …]
|
D | resolve_constant_fill.cc | 24 template <ArrayDataType Type> 56 if (output_array.data_type == ArrayDataType::kNone) { in Run() 78 case ArrayDataType::kFloat: in Run() 79 if (!ComputeFillArray<ArrayDataType::kFloat>(model, op)) { in Run() 83 case ArrayDataType::kUint8: in Run() 84 if (!ComputeFillArray<ArrayDataType::kUint8>(model, op)) { in Run() 88 case ArrayDataType::kInt32: in Run() 89 if (!ComputeFillArray<ArrayDataType::kInt32>(model, op)) { in Run() 93 case ArrayDataType::kInt64: in Run() 94 if (!ComputeFillArray<ArrayDataType::kInt64>(model, op)) { in Run()
|
D | resolve_constant_concatenation.cc | 34 template <ArrayDataType A, typename T> 77 template <ArrayDataType A> 110 CHECK(concatenated_array->data_type == ArrayDataType::kFloat); in SetMinMaxForConcatenedArray() 165 case ArrayDataType::kFloat: in Run() 166 ConcatenateTensorBuffers<ArrayDataType::kFloat>( in Run() 170 case ArrayDataType::kUint8: in Run() 171 ConcatenateTensorBuffers<ArrayDataType::kUint8>( in Run() 174 case ArrayDataType::kInt32: in Run() 175 ConcatenateTensorBuffers<ArrayDataType::kInt32>( in Run() 178 case ArrayDataType::kInt64: in Run() [all …]
|
D | lstm_utils.cc | 25 void CopyArrayData(const Buffer<ArrayDataType::kFloat>& src_buffer, in CopyArrayData() 27 Buffer<ArrayDataType::kFloat>* dst_buffer, int dst_stride, in CopyArrayData() 41 Buffer<ArrayDataType::kFloat>* CreateFloatArrayBuffer(Model* model, in CreateFloatArrayBuffer() 46 array.data_type = ArrayDataType::kFloat; in CreateFloatArrayBuffer() 48 Buffer<ArrayDataType::kFloat>* buffer = in CreateFloatArrayBuffer() 49 &(array.GetMutableBuffer<ArrayDataType::kFloat>()); in CreateFloatArrayBuffer() 61 Buffer<ArrayDataType::kFloat>* buffer = in CopySubArrayToArray() 63 auto& orig_buffer = original_array.GetBuffer<ArrayDataType::kFloat>(); in CopySubArrayToArray() 71 void CopyArrayToSubArray(Buffer<ArrayDataType::kFloat>& tensor_buffer, in CopyArrayToSubArray() 78 auto& sub_buffer = sub_array.GetBuffer<ArrayDataType::kFloat>(); in CopyArrayToSubArray()
|
D | resolve_constant_unary.cc | 83 std::vector<DataType<ArrayDataType::kFloat>> const* input_float_data; in Run() 86 if (cast_op->dst_data_type != ArrayDataType::kFloat) { in Run() 100 if (input_array.buffer->type != ArrayDataType::kFloat) { in Run() 103 input_float_data = &(input_array.GetBuffer<ArrayDataType::kFloat>().data); in Run() 111 output_array.GetMutableBuffer<ArrayDataType::kFloat>().data; in Run() 119 if (input_array.buffer->type == ArrayDataType::kFloat) { in Run() 121 input_array.GetBuffer<ArrayDataType::kFloat>().data[i]); in Run() 122 } else if (input_array.buffer->type == ArrayDataType::kUint8) { in Run() 124 input_array.GetBuffer<ArrayDataType::kUint8>().data[i]); in Run() 125 } else if (input_array.buffer->type == ArrayDataType::kInt32) { in Run() [all …]
|
D | propagate_array_data_types.cc | 28 ArrayDataType data_type) { in SetDataTypeForAllOutputs() 42 model->GetArray(input).data_type == ArrayDataType::kNone) { in Run() 48 std::unordered_map<string, ArrayDataType> old_output_data_types; in Run() 56 SetDataTypeForAllOutputs(model, op, ArrayDataType::kFloat); in Run() 62 SetDataTypeForAllOutputs(model, op, ArrayDataType::kBool); in Run() 66 SetDataTypeForAllOutputs(model, op, ArrayDataType::kInt32); in Run() 72 const ArrayDataType data_type = model->GetArray(op->inputs[1]).data_type; in Run() 87 ArrayDataType data_type; in Run() 88 if (range_op->dtype != ArrayDataType::kNone) { in Run() 114 const ArrayDataType data_type = model->GetArray(op->inputs[0]).data_type; in Run()
|
D | resolve_batch_normalization.cc | 48 CHECK(mean_array.data_type == ArrayDataType::kFloat); in Run() 49 CHECK(multiplier_array.data_type == ArrayDataType::kFloat); in Run() 50 CHECK(offset_array.data_type == ArrayDataType::kFloat); in Run() 96 mul_param_array.data_type = ArrayDataType::kFloat; in Run() 97 add_param_array.data_type = ArrayDataType::kFloat; in Run() 99 mul_param_array.GetMutableBuffer<ArrayDataType::kFloat>().data; in Run() 101 add_param_array.GetMutableBuffer<ArrayDataType::kFloat>().data; in Run() 105 mean_array.GetBuffer<ArrayDataType::kFloat>().data; in Run() 107 multiplier_array.GetBuffer<ArrayDataType::kFloat>().data; in Run() 109 offset_array.GetBuffer<ArrayDataType::kFloat>().data; in Run()
|
D | resolve_constant_strided_slice.cc | 60 template <ArrayDataType Type> 139 if (output_array.data_type == ArrayDataType::kNone) { in Run() 167 case ArrayDataType::kFloat: in Run() 168 StridedSlice<ArrayDataType::kFloat>(*op, input_array, &output_array); in Run() 170 case ArrayDataType::kUint8: in Run() 171 StridedSlice<ArrayDataType::kUint8>(*op, input_array, &output_array); in Run() 173 case ArrayDataType::kInt32: in Run() 174 StridedSlice<ArrayDataType::kInt32>(*op, input_array, &output_array); in Run() 176 case ArrayDataType::kInt64: in Run() 177 StridedSlice<ArrayDataType::kInt64>(*op, input_array, &output_array); in Run()
|
D | resolve_constant_binary.cc | 63 template <ArrayDataType InputsDataType, ArrayDataType OutputDataType> 179 TOCO_HANDLE_CASE(ArrayDataType::kFloat, ArrayDataType::kFloat) in EvaluateBinaryOperatorOnConstantInputs() 180 TOCO_HANDLE_CASE(ArrayDataType::kFloat, ArrayDataType::kBool) in EvaluateBinaryOperatorOnConstantInputs() 181 TOCO_HANDLE_CASE(ArrayDataType::kInt32, ArrayDataType::kInt32) in EvaluateBinaryOperatorOnConstantInputs() 182 TOCO_HANDLE_CASE(ArrayDataType::kInt32, ArrayDataType::kBool) in EvaluateBinaryOperatorOnConstantInputs() 183 TOCO_HANDLE_CASE(ArrayDataType::kInt64, ArrayDataType::kInt64) in EvaluateBinaryOperatorOnConstantInputs() 184 TOCO_HANDLE_CASE(ArrayDataType::kInt64, ArrayDataType::kBool) in EvaluateBinaryOperatorOnConstantInputs()
|
D | resolve_constant_range.cc | 56 if (output_array.data_type == ArrayDataType::kNone) { in Run() 68 CHECK(start_array.data_type == ArrayDataType::kInt32) in Run() 70 CHECK(limit_array.data_type == ArrayDataType::kInt32) in Run() 72 CHECK(delta_array.data_type == ArrayDataType::kInt32) in Run() 76 int start = start_array.GetBuffer<ArrayDataType::kInt32>().data[0]; in Run() 77 int limit = limit_array.GetBuffer<ArrayDataType::kInt32>().data[0]; in Run() 78 int delta = delta_array.GetBuffer<ArrayDataType::kInt32>().data[0]; in Run() 79 auto& buffer = output_array.GetMutableBuffer<ArrayDataType::kInt32>(); in Run()
|
D | resolve_constant_transpose.cc | 28 template <ArrayDataType Type> 115 if (output_array.data_type == ArrayDataType::kNone) { in Run() 145 case ArrayDataType::kFloat: in Run() 146 Transpose<ArrayDataType::kFloat>(model, input_array, op->perm, in Run() 149 case ArrayDataType::kUint8: in Run() 150 Transpose<ArrayDataType::kUint8>(model, input_array, op->perm, in Run() 153 case ArrayDataType::kInt32: in Run() 154 Transpose<ArrayDataType::kInt32>(model, input_array, op->perm, in Run() 157 case ArrayDataType::kInt64: in Run() 158 Transpose<ArrayDataType::kInt64>(model, input_array, op->perm, in Run()
|
D | make_initial_dequantize_operator.cc | 55 if (input_array.data_type != ArrayDataType::kFloat) { in AddDequantizeOperatorToInput() 60 input_array.final_data_type == ArrayDataType::kNone) { in AddDequantizeOperatorToInput() 81 CHECK(input_array.final_data_type == ArrayDataType::kUint8); in AddDequantizeOperatorToInput() 82 input_array.data_type = ArrayDataType::kUint8; in AddDequantizeOperatorToInput() 83 dequantized_input_array.data_type = ArrayDataType::kFloat; in AddDequantizeOperatorToInput() 88 GetQuantizationParamsFromMinMax<ArrayDataType::kUint8>( in AddDequantizeOperatorToInput()
|
D | resolve_constant_fake_quant.cc | 49 CHECK(input_array.data_type == ArrayDataType::kFloat); in Run() 50 output_array.data_type = ArrayDataType::kFloat; in Run() 52 const auto& input_buffer = input_array.GetBuffer<ArrayDataType::kFloat>(); in Run() 54 auto& output_buffer = output_array.GetMutableBuffer<ArrayDataType::kFloat>(); in Run() 58 GetQuantizationParamsFromMinMax<ArrayDataType::kUint8>( in Run()
|
D | resolve_reorder_axes.cc | 32 template <typename T, ArrayDataType DataType> 71 if (input_array.buffer->type == ArrayDataType::kFloat) { in Run() 72 ReorderAxes<float, ArrayDataType::kFloat>(reorder_op->input_axes_order, in Run() 75 } else if (input_array.buffer->type == ArrayDataType::kInt32) { in Run() 76 ReorderAxes<uint8, ArrayDataType::kUint8>(reorder_op->input_axes_order, in Run()
|
D | lstm_utils.h | 62 Buffer<ArrayDataType::kFloat>* CreateFloatArrayBuffer(Model* model, 79 void CopyArrayData(const Buffer<ArrayDataType::kFloat>& src_buffer, 81 Buffer<ArrayDataType::kFloat>* dst_buffer, int dst_stride, 94 void CopyArrayToSubArray(Buffer<ArrayDataType::kFloat>& tensor_buffer,
|
D | propagate_fixed_sizes.cc | 137 auto& float_buffer = bias_array.GetMutableBuffer<ArrayDataType::kFloat>(); in EnsureBiasVectorShape() 295 CHECK(dims_array.data_type == ArrayDataType::kInt32) << "dims must be int32"; in ProcessFillOperator() 300 dims_array.GetBuffer<ArrayDataType::kInt32>().data; in ProcessFillOperator() 359 CHECK(shape_array.data_type == ArrayDataType::kInt32) in ProcessTensorFlowReshapeOperator() 368 shape_array.GetBuffer<ArrayDataType::kInt32>().data; in ProcessTensorFlowReshapeOperator() 484 CHECK(reduction_array.buffer->type == ArrayDataType::kInt32); in ProcessTensorFlowReductionOperator() 486 reduction_array.GetBuffer<ArrayDataType::kInt32>().data; in ProcessTensorFlowReductionOperator() 620 CHECK(start_array.data_type == ArrayDataType::kInt32) in ProcessRangeOperator() 622 CHECK(limit_array.data_type == ArrayDataType::kInt32) in ProcessRangeOperator() 624 CHECK(delta_array.data_type == ArrayDataType::kInt32) in ProcessRangeOperator() [all …]
|
/external/tensorflow/tensorflow/contrib/lite/toco/ |
D | model.h | 162 enum class ArrayDataType { enum 178 template <ArrayDataType A> 181 struct DataTypeImpl<ArrayDataType::kNone> { 185 struct DataTypeImpl<ArrayDataType::kBool> { 189 struct DataTypeImpl<ArrayDataType::kFloat> { 193 struct DataTypeImpl<ArrayDataType::kInt8> { 197 struct DataTypeImpl<ArrayDataType::kUint8> { 201 struct DataTypeImpl<ArrayDataType::kInt16> { 205 struct DataTypeImpl<ArrayDataType::kUint16> { 209 struct DataTypeImpl<ArrayDataType::kInt32> { [all …]
|
D | dump_graphviz.cc | 110 if (array.buffer->type == ArrayDataType::kFloat) { in AppendArrayVal() 111 const auto& data = array.GetBuffer<ArrayDataType::kFloat>().data; in AppendArrayVal() 116 } else if (array.buffer->type == ArrayDataType::kUint8) { in AppendArrayVal() 117 const auto& data = array.GetBuffer<ArrayDataType::kUint8>().data; in AppendArrayVal() 122 } else if (array.buffer->type == ArrayDataType::kInt32) { in AppendArrayVal() 123 const auto& data = array.GetBuffer<ArrayDataType::kInt32>().data; in AppendArrayVal() 128 } else if (array.buffer->type == ArrayDataType::kInt64) { in AppendArrayVal() 129 const auto& data = array.GetBuffer<ArrayDataType::kInt64>().data; in AppendArrayVal() 146 if (array.data_type == ArrayDataType::kFloat) { in GetPropertiesForArray() 148 } else if (array.data_type == ArrayDataType::kInt32) { in GetPropertiesForArray() [all …]
|
D | tooling_util.cc | 367 case ArrayDataType::kNone: in LogArray() 370 case ArrayDataType::kFloat: in LogArray() 373 case ArrayDataType::kInt32: in LogArray() 376 case ArrayDataType::kUint8: in LogArray() 379 case ArrayDataType::kString: in LogArray() 388 case ArrayDataType::kNone: in LogArray() 391 case ArrayDataType::kFloat: in LogArray() 394 case ArrayDataType::kInt32: in LogArray() 397 case ArrayDataType::kUint8: in LogArray() 400 case ArrayDataType::kString: in LogArray() [all …]
|
/external/tensorflow/tensorflow/contrib/lite/toco/graph_transformations/tests/ |
D | resolve_constant_concatenation_test.cc | 127 in_array.data_type = ArrayDataType::kFloat; in PrepareModel() 136 in_array.GetMutableBuffer<toco::ArrayDataType::kFloat>(); in PrepareModel() 139 in_array.GetMutableBuffer<toco::ArrayDataType::kFloat>().data.data(); in PrepareModel() 148 out_array.data_type = ArrayDataType::kFloat; in PrepareModel() 175 EXPECT_THAT(concatenated_array->GetBuffer<toco::ArrayDataType::kFloat>().data, in TEST_F() 194 EXPECT_THAT(concatenated_array->GetBuffer<toco::ArrayDataType::kFloat>().data, in TEST_F() 213 EXPECT_THAT(concatenated_array->GetBuffer<toco::ArrayDataType::kFloat>().data, in TEST_F()
|