Home
last modified time | relevance | path

Searched refs:bias_tensor (Results 1 – 25 of 29) sorted by relevance

12

/external/tensorflow/tensorflow/python/kernel_tests/
Dbias_op_base.py156 bias_tensor = constant_op.constant(bias, shape=bias_shape, dtype=dtype)
160 def bias_add(input_tensor, bias_tensor): argument
162 input_tensor, bias_tensor, data_format=data_format)
169 return bias_add(input_tensor, bias_tensor)
171 def bias_add_2(bias_tensor): argument
172 return bias_add(input_tensor, bias_tensor)
177 bias_add_2, [bias_tensor])
182 tape.watch(bias_tensor)
183 bias_add_output = bias_add(input_tensor, bias_tensor)
185 return tape.gradient(gradient_injector_output, bias_tensor)
[all …]
/external/tensorflow/tensorflow/lite/delegates/hexagon/builders/
Dconv_2d_helpers.cc89 const auto& bias_tensor = context->tensors[inputs->data[2]]; in ProcessPerChannelQuantizedBias() local
97 auto* bias_data = bias_tensor.data.i32; in ProcessPerChannelQuantizedBias()
98 const int bias_size = NumElements(&bias_tensor); in ProcessPerChannelQuantizedBias()
102 bias_tensor.name); in ProcessPerChannelQuantizedBias()
255 const auto& bias_tensor = context->tensors[inputs->data[2]]; in InitializeBiasNodes() local
265 graph_builder_->AddConstNodeWithData(inputs->data[2], bias_tensor); in InitializeBiasNodes()
269 ComputeMinAndMaxQuantValues(bias_tensor, &bias_min, &bias_max)); in InitializeBiasNodes()
Dtranspose_conv_2d_builder.cc141 const auto& bias_tensor = context->tensors[inputs->data[3]]; in PopulateSubGraph() local
142 if (bias_tensor.allocation_type != kTfLiteMmapRo) { in PopulateSubGraph()
145 bias_tensor.name); in PopulateSubGraph()
156 graph_builder_->AddConstNodeWithData(inputs->data[3], bias_tensor); in PopulateSubGraph()
158 ComputeMinAndMaxQuantValues(bias_tensor, &bias_min, &bias_max)); in PopulateSubGraph()
Dmatmul_builder.cc93 const auto& bias_tensor = context->tensors[bias_tensor_id]; in AddFullyConnectedHelper() local
95 OpBuilder::ComputeMinAndMaxQuantValues(bias_tensor, &bias_min, &bias_max); in AddFullyConnectedHelper()
/external/tensorflow/tensorflow/lite/tools/optimize/
Dquantize_model.cc142 const TensorT* weight_tensor, TensorT* bias_tensor, in QuantizeBias() argument
146 if (bias_tensor->shape.size() != 1) { in QuantizeBias()
151 int32_t channel_dim_size = bias_tensor->shape[0]; in QuantizeBias()
156 if (bias_tensor->shape[0] != weight_tensor->shape[channel_dim_index]) { in QuantizeBias()
160 bias_tensor->shape[0], weight_tensor->shape[channel_dim_index]); in QuantizeBias()
178 model, bias_tensor, input_tensor->quantization->scale[0], in QuantizeBias()
182 model, bias_tensor, input_tensor->quantization->scale[0], in QuantizeBias()
195 model, bias_tensor, in QuantizeBias()
200 model, bias_tensor, in QuantizeBias()
1110 TensorT* bias_tensor = subgraph->tensors[op->inputs[bias_idx]].get(); in QuantizeBiases() local
[all …]
Dquantize_model_test.cc614 const auto bias_tensor = in TEST_F() local
623 EXPECT_EQ(bias_tensor->type, TensorType_INT32); in TEST_F()
629 ASSERT_TRUE(bias_tensor->quantization); in TEST_F()
631 const std::vector<float>& bias_scales = bias_tensor->quantization->scale; in TEST_F()
653 const auto bias_buffer = model_.buffers[bias_tensor->buffer].get(); in TEST_F()
654 ASSERT_EQ(bias_buffer->data.size(), sizeof(int32_t) * bias_tensor->shape[0]); in TEST_F()
658 readonly_model_->buffers()->Get(bias_tensor->buffer); in TEST_F()
663 for (size_t i = 0; i < bias_tensor->shape[0]; i++) { in TEST_F()
723 const auto bias_tensor = in TEST_P() local
732 EXPECT_EQ(bias_tensor->type, tensor_type_ == TensorType_INT8 in TEST_P()
[all …]
/external/tensorflow/tensorflow/core/kernels/mkl/
Dmkl_matmul_op_fused.cc61 const Tensor& bias_tensor = MklGetInput(ctx, this->kInputIndexBias); in Compute() local
80 OP_REQUIRES(ctx, TensorShapeUtils::IsVector(bias_tensor.shape()), in Compute()
98 OP_REQUIRES(ctx, bias_tensor.shape().dim_size(0) == channel, in Compute()
101 bias_tensor.shape().DebugString(), " vs. ", channel)); in Compute()
205 T* bias_data = const_cast<T*>(bias_tensor.flat<T>().data()); in Compute()
Dmkl_qmatmul_op.cc165 const Tensor& bias_tensor = MklGetInput(context, this->kInputIndexBias); in Compute() local
225 memory::dims bias_dims = {static_cast<int>(bias_tensor.dim_size(0))}; in Compute()
295 context, matmul_fwd_pd, bias_tensor, weight_tensor, cpu_stream); in Compute()
397 const Tensor& bias_tensor, const Tensor& weight_tensor, in GetBiasHandle() argument
403 const_cast<Tbias*>(bias_tensor.flat<Tbias>().data())); in GetBiasHandle()
425 const_cast<float*>(bias_tensor.flat<float>().data())); in GetBiasHandle()
477 const_cast<Tbias*>(bias_tensor.flat<Tbias>().data())); in GetBiasHandle()
Dmkl_conv_ops.cc729 const Tensor& bias_tensor = MklGetInput(context, kInputIndex_Bias); in Compute() local
731 this->GetBiasHandle(context, conv_fwd_pd, bias_tensor); in Compute()
840 const Tensor& bias_tensor) { in GetBiasHandle() argument
843 const_cast<Tbias*>(bias_tensor.flat<Tbias>().data())); in GetBiasHandle()
1503 const Tensor& bias_tensor) override { in GetBiasHandle() argument
1509 const_cast<Tbias*>(bias_tensor.flat<Tbias>().data())); in GetBiasHandle()
1550 auto bias_md = memory::desc({static_cast<int>(bias_tensor.NumElements())}, in GetBiasHandle()
1553 const_cast<Tbias*>(bias_tensor.flat<Tbias>().data())); in GetBiasHandle()
1600 Tensor** bias_tensor) { in AllocatePersistentTensor() argument
1601 DCHECK(bias_tensor); in AllocatePersistentTensor()
[all …]
/external/tensorflow/tensorflow/lite/micro/kernels/
Dsvdf_common.cc36 const TfLiteEvalTensor* bias_tensor, in EvalIntegerSvdfReference() argument
131 if (bias_tensor) { in EvalIntegerSvdfReference()
134 tflite::micro::GetTensorData<int32_t>(bias_tensor); in EvalIntegerSvdfReference()
Ddepthwise_conv_test.cc191 TfLiteTensor bias_tensor = CreatePerChannelQuantizedBiasTensor( in TestDepthwiseConvQuantizedPerChannel() local
219 bias_tensor, in TestDepthwiseConvQuantizedPerChannel()
732 TfLiteTensor bias_tensor = in TF_LITE_MICRO_TEST() local
740 bias_tensor.quantization = {kTfLiteAffineQuantization, &bias_quant}; in TF_LITE_MICRO_TEST()
758 bias_tensor, in TF_LITE_MICRO_TEST()
819 TfLiteTensor bias_tensor = in TF_LITE_MICRO_TEST() local
839 bias_tensor, in TF_LITE_MICRO_TEST()
966 TfLiteTensor bias_tensor = in TF_LITE_MICRO_TEST() local
975 bias_tensor.quantization = {kTfLiteAffineQuantization, &bias_quant}; in TF_LITE_MICRO_TEST()
997 bias_tensor, in TF_LITE_MICRO_TEST()
Dconv_test.cc482 TfLiteTensor bias_tensor = in TF_LITE_MICRO_TEST() local
490 bias_tensor.quantization = {kTfLiteAffineQuantization, &bias_quant}; in TF_LITE_MICRO_TEST()
508 bias_tensor, in TF_LITE_MICRO_TEST()
558 TfLiteTensor bias_tensor = in TF_LITE_MICRO_TEST() local
578 bias_tensor, in TF_LITE_MICRO_TEST()
695 TfLiteTensor bias_tensor = in TF_LITE_MICRO_TEST() local
705 bias_tensor.quantization = {kTfLiteAffineQuantization, &bias_quant}; in TF_LITE_MICRO_TEST()
726 bias_tensor, in TF_LITE_MICRO_TEST()
Dsvdf.h43 const TfLiteEvalTensor* bias_tensor,
Dconv_test_common.cc209 TfLiteTensor bias_tensor = CreatePerChannelQuantizedBiasTensor( in TestConvQuantizedPerChannel() local
235 bias_tensor, in TestConvQuantizedPerChannel()
/external/tensorflow/tensorflow/lite/micro/kernels/cmsis_nn/
Dsvdf.cc210 const TfLiteEvalTensor* bias_tensor, in EvalIntegerSVDF() argument
227 bias_dims.n = bias_tensor->dims->data[0]; in EvalIntegerSVDF()
230 state_dims.n = bias_tensor->dims->data[0]; in EvalIntegerSVDF()
231 state_dims.h = bias_tensor->dims->data[1]; in EvalIntegerSVDF()
277 &bias_dims, (int32_t*)tflite::micro::GetTensorData<int32_t>(bias_tensor), in EvalIntegerSVDF()
/external/tensorflow/tensorflow/lite/micro/kernels/xtensa/
Dsvdf.cc58 const TfLiteEvalTensor* bias_tensor, in EvalIntegerSvdfHifimini() argument
197 if (bias_tensor) { in EvalIntegerSvdfHifimini()
200 tflite::micro::GetTensorData<int32_t>(bias_tensor); in EvalIntegerSvdfHifimini()
254 const TfLiteEvalTensor* bias_tensor, const TfLiteSVDFParams* params, in EvalIntegerSvdfHifi4() argument
301 tflite::micro::GetTensorData<int32_t>(bias_tensor); in EvalIntegerSvdfHifi4()
/external/tensorflow/tensorflow/lite/delegates/hexagon/builders/tests/
Dtranspose_conv_test.cc93 auto* bias_tensor = interpreter_->tensor(bias_); in SetBias() local
94 bias_tensor->allocation_type = kTfLiteMmapRo; in SetBias()
Dmatmul_test.cc66 auto* bias_tensor = interpreter_->tensor(bias_); in FullyConnectedOpModel() local
67 bias_tensor->allocation_type = kTfLiteMmapRo; in FullyConnectedOpModel()
/external/tensorflow/tensorflow/core/grappler/optimizers/
Dmkl_remapper_test.cc110 auto bias_tensor = GenerateRandomTensor<DT_FLOAT>( in FuseConv2DWithBiasAndAddNOrAdd() local
117 {"bias", bias_tensor}, in FuseConv2DWithBiasAndAddNOrAdd()
480 auto bias_tensor = GenerateRandomTensor<DT_FLOAT>( in TEST_F() local
487 {"bias", bias_tensor}, in TEST_F()
/external/tensorflow/tensorflow/lite/delegates/xnnpack/
Dxnnpack_delegate.cc1259 const TfLiteTensor& bias_tensor = tensors[bias_tensor_id]; in VisitConv2DNode() local
1261 logging_context, bias_tensor, node->inputs->data[2], node_index)); in VisitConv2DNode()
1262 TF_LITE_ENSURE_STATUS(CheckTensorShape(logging_context, bias_tensor, 1, in VisitConv2DNode()
1266 logging_context, bias_tensor, node->inputs->data[2], node_index)); in VisitConv2DNode()
1354 const TfLiteTensor& bias_tensor = tensors[bias_tensor_id]; in VisitDepthwiseConv2DNode() local
1356 logging_context, bias_tensor, node->inputs->data[2], node_index)); in VisitDepthwiseConv2DNode()
1357 TF_LITE_ENSURE_STATUS(CheckTensorShape(logging_context, bias_tensor, 1, in VisitDepthwiseConv2DNode()
1361 logging_context, bias_tensor, node->inputs->data[2], node_index)); in VisitDepthwiseConv2DNode()
1587 const TfLiteTensor& bias_tensor = tensors[bias_tensor_id]; in VisitFullyConnectedNode() local
1589 logging_context, bias_tensor, node->inputs->data[2], node_index)); in VisitFullyConnectedNode()
[all …]
/external/XNNPACK/bench/
Dconvolution.cc895 arm_compute::Tensor bias_tensor; in armcl_convolution_f32() local
896 bias_tensor.allocator()->init(bias_info); in armcl_convolution_f32()
897 bias_tensor.allocator()->allocate(); in armcl_convolution_f32()
927 reinterpret_cast<float*>(bias_tensor.buffer()), in armcl_convolution_f32()
928 reinterpret_cast<float*>(bias_tensor.buffer()) + bias_shape.total_size(), in armcl_convolution_f32()
960 &input_tensor, &kernelTensor, &bias_tensor, &output_tensor, in armcl_convolution_f32()
974 &input_tensor, &kernelTensor, &bias_tensor, &output_tensor, in armcl_convolution_f32()
989 &input_tensor, &kernelTensor, &bias_tensor, &output_tensor, in armcl_convolution_f32()
1024 reinterpret_cast<const float*>(bias_tensor.buffer()), in armcl_convolution_f32()
1036 bias_tensor.allocator()->free(); in armcl_convolution_f32()
/external/tensorflow/tensorflow/lite/delegates/hexagon/
Dutils.cc211 const auto& bias_tensor = context->tensors[node->inputs->data[2]]; in IsNodeSupportedByHexagon() local
212 bias_const_or_no_bias = bias_tensor.allocation_type == kTfLiteMmapRo; in IsNodeSupportedByHexagon()
/external/tensorflow/tensorflow/lite/micro/kernels/arc_mli/
Ddepthwise_conv_slicing_test.cc147 TfLiteTensor bias_tensor = CreatePerChannelQuantizedBiasTensor( in TestDepthwiseConvQuantizedPerChannel() local
174 bias_tensor, in TestDepthwiseConvQuantizedPerChannel()
Dconv_slicing_test.cc232 TfLiteTensor bias_tensor = CreatePerChannelQuantizedBiasTensor( in TestConvQuantizedPerChannel() local
259 bias_tensor, in TestConvQuantizedPerChannel()
/external/tensorflow/tensorflow/lite/delegates/nnapi/
Dnnapi_delegate.cc3108 TfLiteTensor* bias_tensor = &mapping_args.context->tensors[bias_index]; in Map() local
3114 bias_tensor->type = kTfLiteFloat32; in Map()
3116 bias_tensor->type = kTfLiteInt32; in Map()
3127 bias_tensor->allocation_type = kTfLiteDynamic; in Map()
3128 mapping_args.context->ResizeTensor(mapping_args.context, bias_tensor, in Map()
3136 memset(bias_tensor->data.f, 0, output_depth * sizeof(float)); in Map()
3137 mapping_args.builder->AddVectorFloat32Operand(bias_tensor->data.f, in Map()
3140 memset(bias_tensor->data.i32, 0, output_depth * sizeof(int)); in Map()
3149 bias_tensor->params.scale = in Map()
3152 bias_tensor->data.i32, output_depth, in Map()

12