Home
last modified time | relevance | path

Searched refs:qint8 (Results 1 – 25 of 113) sorted by relevance

12345

/external/tensorflow/tensorflow/compiler/mlir/xla/tests/
Dlegalize-tf-types.mlir3 func @relu_qint8(%arg0: tensor<1x!tf.qint8>) -> tensor<1x!tf.qint8> {
6 %0 = "tf.Relu"(%arg0) : (tensor<1x!tf.qint8>) -> tensor<1x!tf.qint8>
7 return %0: tensor<1x!tf.qint8>
10 …if_qint8(%arg0: tensor<i1>, %arg1: tensor<1x!tf.qint8>, %arg2: tensor<1x!tf.qint8>) -> tensor<1x!t…
19 "tf.Yield"(%arg1) : (tensor<1x!tf.qint8>) -> ()
21 "tf.Yield"(%arg2) : (tensor<1x!tf.qint8>) -> ()
22 }) {is_stateless = false} : (tensor<i1>) -> tensor<1x!tf.qint8>
23 return %0 : tensor<1x!tf.qint8>
26 func @id_qint8(%arg0: tensor<1x!tf.qint8>) -> tensor<1x!tf.qint8> {
29 return %arg0: tensor<1x!tf.qint8>
/external/tensorflow/tensorflow/core/kernels/mkl/
Dmkl_qmatmul_op.cc309 std::is_same<Toutput, qint8>::value) { in Compute()
320 std::is_same<Toutput, qint8>::value || in Compute()
344 MklQuantizationRangeForMultiplication<quint8, qint8, qint32>( in ComputeOutputRangeForInt32()
360 std::is_same<Toutput, qint8>::value || in ExtendMklDnnMatMulFwdParams()
374 } else if (std::is_same<Toutput, qint8>::value) { in ExtendMklDnnMatMulFwdParams()
421 qint8* wt_buf = static_cast<qint8*>( in GetBiasHandle()
422 const_cast<qint8*>(weight_tensor.flat<qint8>().data())); in GetBiasHandle()
524 MklDnnQuantizedMatMulOp<Device, quint8, qint8, Tbias, in ExtendMklDnnMatMulFwdParams()
537 .TypeConstraint<qint8>("T2")
545 .TypeConstraint<qint8>("T2")
[all …]
Dmkl_conv_ops.cc1344 : public MklConvOp<Device, Tinput, qint8, Tbias, Toutput, Ttemp_output,
1360 : MklConvOp<Device, Tinput, qint8, Tbias, Toutput, Ttemp_output, int32, in MklQuantizedConv2DOp()
1377 MklConvOp<Device, Tinput, qint8, Tbias, Toutput, Ttemp_output, int32, in Compute()
1396 std::is_same<Toutput, qint8>::value) { in Compute()
1412 MklQuantizationRangeForMultiplication<Tinput, qint8, qint32>( in Compute()
1429 MklQuantizationRangeForMultiplication<Tinput, qint8, qint32>( in Compute()
1439 MklConvOp<Device, Tinput, qint8, Tbias, Toutput, Ttemp_output, int32, in ExtendConvFwdParams()
1446 std::is_same<Toutput, qint8>::value) { in ExtendConvFwdParams()
1774 MklConvOp<Device, Tinput, qint8, Tbias, Toutput, Ttemp_output, int32, in AllocateOutputTensor()
1844 .TypeConstraint<qint8>("Tfilter")
[all …]
Dmkl_quantized_conv_ops_test.cc88 .Attr("Tfilter", DataTypeToEnum<qint8>::v()) in ConfigureQuantizedConv2D()
117 AddInputFromArray<qint8>( in RunQuantizedDepthwiseConv2DOp()
223 FloatTensorToQuantized<qint8>(filter_float, filter_min, filter_max); in TEST_F()
227 AddInputFromArray<qint8>(filter_quantized.shape(), in TEST_F()
228 filter_quantized.flat<qint8>()); in TEST_F()
314 .Attr("Tinput", DataTypeToEnum<qint8>::v()) in TEST_F()
315 .Attr("Tfilter", DataTypeToEnum<qint8>::v()) in TEST_F()
331 FloatTensorToQuantized<qint8>(image_float, image_min, image_max); in TEST_F()
348 FloatTensorToQuantized<qint8>(filter_float, filter_min, filter_max); in TEST_F()
350 AddInputFromArray<qint8>(image_quantized.shape(), in TEST_F()
[all …]
Dmkl_requantize_per_channel_op.cc107 ? memory::desc(dims_mkl_order, MklDnnType<qint8>(), in Compute()
117 const_cast<qint8*>(output->flat<qint8>().data())); in Compute()
175 .TypeConstraint<qint8>("out_type"),
176 MklRequantizePerChannelOp<CPUDevice, qint8>);
Dmkl_quantized_conv_ops_perchannel_test.cc89 .Attr("Tfilter", DataTypeToEnum<qint8>::v()) in TEST_F()
143 FloatTensorToQuantized<qint8>(filter_float, filter_min, filter_max); in TEST_F()
148 AddInputFromArray<qint8>(filter_quantized.shape(), in TEST_F()
149 filter_quantized.flat<qint8>()); in TEST_F()
Dmkl_qmatmul_op_test.cc100 AddInputFromArray<qint8>(TensorShape({3, 4}), in TEST_F()
173 AddInputFromArray<qint8>(TensorShape({3, 4}), in TEST_F()
256 AddInputFromArray<qint8>(TensorShape({3, 2}), {1, 4, 2, 5, 3, 6}); in TEST_F()
339 AddInputFromArray<qint8>(TensorShape({3, 4}), in TEST_F()
432 AddInputFromArray<qint8>(TensorShape({3, 4}), in TEST_F()
521 AddInputFromArray<qint8>(TensorShape({3, 4}), in TEST_F()
601 AddInputFromArray<qint8>(TensorShape({3, 4}), in TEST_F()
695 AddInputFromArray<qint8>(TensorShape({3, 4}), in TEST_F()
/external/tensorflow/tensorflow/core/kernels/
Drelu_op.cc144 void Relu<GPUDevice, qint8>::operator()(
145 const GPUDevice& d, typename TTypes<qint8>::ConstTensor features,
146 typename TTypes<qint8>::Tensor activations);
147 extern template struct Relu<GPUDevice, qint8>;
190 class ReluOp<Device, qint8>
191 : public UnaryElementWiseOp<qint8, ReluOp<Device, qint8>> {
193 using UnaryElementWiseOp<qint8, ReluOp<Device, qint8>>::UnaryElementWiseOp;
196 auto flat_input = input.flat<qint8>(); in Operate()
201 functor::Relu<Device, qint8> func; in Operate()
202 func(context->eigen_device<Device>(), flat_input, output->flat<qint8>()); in Operate()
[all …]
Dquantize_op_test.cc171 .Attr("T", DataTypeToEnum<qint8>::v()) in TEST_P()
199 test::FillValues<qint8>( in TEST_P()
201 ScalePerSliceAlongAxis<qint8>(dims, -1, {-128, 0, 1, 1, 2, 64, 127})); in TEST_P()
212 test::ExpectTensorEqual<qint8>(expected, *GetOutput(0)); in TEST_P()
221 .Attr("T", DataTypeToEnum<qint8>::v()) in TEST_P()
249 test::FillValues<qint8>( in TEST_P()
251 ScalePerSliceAlongAxis<qint8>(dims, -1, {-127, 0, 1, 1, 2, 64, 126})); in TEST_P()
262 test::ExpectTensorEqual<qint8>(expected, *GetOutput(0)); in TEST_P()
274 .Attr("T", DataTypeToEnum<qint8>::v()) in TEST_F()
285 test::FillValues<qint8>(&expected, {-64, 0, 127}); in TEST_F()
[all …]
Ddequantize_op_test.cc193 RunDequantizeMinCombinedTest<qint8>(0, 255.0f, "Dequantize"); in TEST_F()
206 RunDequantizeBfloat16MinCombinedTest<qint8>(0, 255.0f); in TEST_F()
229 RunDequantizeScaledTest<qint8>(-255.0f, 127.0f, -1, {0}, {0.0}); in TEST_F()
232 RunDequantizeScaledTest<qint8>(-10.0f, 127.0f, -1, {-127}, {-127.0}); in TEST_F()
235 RunDequantizeScaledTest<qint8>(-2.0f, 1.0f, -1, {-128}, {-2.0}); in TEST_F()
238 RunDequantizeScaledTest<qint8>(-1.0f, 300.0f, -1, {42}, {99.212601}); in TEST_F()
241 RunDequantizeScaledTest<qint8>(-12.8f, 12.7f, 1, {-20, -10, 0, 1, 10, 20}, in TEST_F()
245 RunDequantizeScaledTest<qint8>(-12.8f, 12.7f, 3, {-20, -10, 0, 1, 10, 20}, in TEST_F()
284 BM_DequantizeMinCombinedCpu<qint8>(state); in BM_DequantizeMinCombinedCpuQint8()
332 BM_DequantizeBfloat16MinCombinedCpu<qint8>(state); in BM_DequantizeBfloat16MinCombinedCpuQint8()
Dmaxpooling_op.h43 struct SpatialMaxPooling<Device, qint8> {
44 void operator()(const Device& d, typename TTypes<qint8, 4>::Tensor output,
45 typename TTypes<qint8, 4>::ConstTensor input, int window_rows,
Dquantized_bias_add_op.cc102 .TypeConstraint<qint8>("T1")
103 .TypeConstraint<qint8>("T2")
105 QuantizedBiasAddOp<qint8, qint8, qint32>);
Dsave_v2_op_test.cc90 AddInput<qint8>(TensorShape({3, 2}), in TEST_F()
91 [](int x) -> qint8 { return *reinterpret_cast<qint8*>(&x); }); in TEST_F()
95 return *reinterpret_cast<qint32*>(&x) * qint8(2); in TEST_F()
207 EXPECT_EQ(*reinterpret_cast<qint8*>(&i), val.template flat<qint8>()(i)); in TEST_F()
223 EXPECT_EQ(*reinterpret_cast<qint32*>(&i) * qint8(2), in TEST_F()
Dsave_op_test.cc93 AddInput<qint8>(TensorShape({3, 2}), in TEST_F()
94 [](int x) -> qint8 { return *reinterpret_cast<qint8*>(&x); }); in TEST_F()
98 return *reinterpret_cast<qint32*>(&x) * qint8(2); in TEST_F()
226 qint8 data[6]; in TEST_F()
229 EXPECT_EQ(*reinterpret_cast<qint8*>(&i), data[i]); in TEST_F()
247 EXPECT_EQ(*reinterpret_cast<qint32*>(&i) * qint8(2), data[i]); in TEST_F()
456 AddInput<qint8>(TensorShape({3, 2}), in TEST_F()
457 [](int x) -> qint8 { return *reinterpret_cast<qint8*>(&x); }); in TEST_F()
461 return *reinterpret_cast<qint32*>(&x) * qint8(2); in TEST_F()
534 qint8 data[6]; in TEST_F()
Dquantized_pooling_ops.cc142 Name("QuantizedAvgPool").Device(DEVICE_CPU).TypeConstraint<qint8>("T"),
143 QuantizedAvgPoolingOp<CPUDevice, qint8>);
146 Name("QuantizedMaxPool").Device(DEVICE_CPU).TypeConstraint<qint8>("T"),
147 QuantizedMaxPoolingOp<CPUDevice, qint8>);
Drestore_v2_op_test.cc146 Tensor input_6 = MakeInput<qint8>( in RunTest()
148 [](int x) -> qint8 { return *reinterpret_cast<qint8*>(&x); }); in RunTest()
153 return *reinterpret_cast<qint32*>(&x) * qint8(2); in RunTest()
261 EXPECT_EQ(*reinterpret_cast<qint8*>(&i), output->flat<qint8>()(i)); in RunTest()
273 EXPECT_EQ(*reinterpret_cast<qint32*>(&i) * qint8(2), in RunTest()
Dgather_nd_op_test.cc100 AddInputFromArray<qint8>(TensorShape({5}), {0, 1, 2, 8, 4}); in TEST_F()
105 test::FillValues<qint8>(&expected, {8, 4}); in TEST_F()
106 test::ExpectTensorEqual<qint8>(expected, *GetOutput(0)); in TEST_F()
Drestore_op_test.cc128 Tensor input_6 = MakeInput<qint8>(TensorShape({3, 2}), [](int x) -> qint8 { in TEST_F()
129 return *reinterpret_cast<qint8*>(&x); in TEST_F()
135 return *reinterpret_cast<qint32*>(&x) * qint8(2); in TEST_F()
251 EXPECT_EQ(*reinterpret_cast<qint8*>(&i), output->flat<qint8>()(i)); in TEST_F()
263 EXPECT_EQ(*reinterpret_cast<qint32*>(&i) * qint8(2), in TEST_F()
Drelu_op_gpu.cu.cc217 struct Relu<Device, qint8> {
222 void operator()(const Device& d, typename TTypes<qint8>::ConstTensor input, in operator ()()
223 typename TTypes<qint8>::Tensor output) { in operator ()()
254 template struct functor::Relu<GPUDevice, qint8>;
Ddepthtospace_op.cc70 constexpr bool is_int8x4 = std::is_same<T, qint8>::value; in Compute()
205 Name("DepthToSpace").Device(DEVICE_GPU).TypeConstraint<qint8>("T"),
206 DepthToSpaceOp<GPUDevice, qint8>);
Ddequantize_op.cc237 .TypeConstraint<qint8>("T")
239 DequantizeOp<CPUDevice, qint8, float>);
263 .TypeConstraint<qint8>("T")
265 DequantizeOp<CPUDevice, qint8, bfloat16>);
/external/tensorflow/tensorflow/python/ops/
Ddequantize_op_test.py45 dtypes.qint8: np.int8,
78 self._testDequantizeOp(np.array([-128, 0, 127]), -1.0, 2.0, dtypes.qint8)
79 self._testDequantizeOp(np.array([-2, 4, -17]), -5.0, -3.0, dtypes.qint8)
80 self._testDequantizeOp(np.array([0, -4, 42, -108]), 5.0, 40.0, dtypes.qint8)
83 self._testDequantizeOp(np.array([-128, 0, 127]), -1.0, 2.0, dtypes.qint8,
85 self._testDequantizeOp(np.array([-2, 4, -17]), -5.0, -3.0, dtypes.qint8,
87 self._testDequantizeOp(np.array([0, -4, 42, -108]), 5.0, 40.0, dtypes.qint8,
91 self._testDequantizeOp(np.array([-128, 0, 127]), -1.0, 2.0, dtypes.qint8,
93 self._testDequantizeOp(np.array([-2, 4, -17]), -5.0, -3.0, dtypes.qint8,
95 self._testDequantizeOp(np.array([0, -4, 42, -108]), 5.0, 40.0, dtypes.qint8,
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/
Dspacetodepth_op_test.py234 if dtype == dtypes.qint8:
256 if dtype == dtypes.qint8:
271 if data_type == dtypes.qint8:
276 t, _, _ = gen_array_ops.quantize_v2(t, -128.0, 127.0, dtypes.qint8)
286 assert data_type == dtypes.qint8
291 actual = array_ops.bitcast(actual, dtypes.qint8)
296 actual = array_ops.bitcast(actual, dtypes.qint8)
302 expected = array_ops.bitcast(expected, dtypes.qint8)
318 self.compareToTranspose(3, 2, 3, 1, 2, "NHWC", dtypes.qint8, False)
319 self.compareToTranspose(1, 2, 3, 2, 2, "NHWC", dtypes.qint8, False)
[all …]
/external/tensorflow/tensorflow/core/framework/
Dtype_traits.h41 struct is_quantized<qint8> : true_type {};
80 class numeric_limits<tensorflow::qint8>
97 struct is_signed<tensorflow::qint8> : public is_signed<tensorflow::int8> {};
/external/tensorflow/tensorflow/core/grappler/
Dutils_test.cc623 TestSetTensorValue<qint8>(DT_QINT8, -8, /*success=*/true, /*error_msg=*/""); in TEST()
624 TestSetTensorValue<qint8>(DT_QINT8, 0, /*success=*/true, /*error_msg=*/""); in TEST()
625 TestSetTensorValue<qint8>(DT_QINT8, 8, /*success=*/true, /*error_msg=*/""); in TEST()
626 TestSetTensorValue<qint8>(DT_QINT8, std::numeric_limits<qint8>::min(), in TEST()
628 TestSetTensorValue<qint8>(DT_QINT8, std::numeric_limits<qint8>::max(), in TEST()
630 TestSetTensorValue<qint8>(DT_QINT8, kMinInt, /*success=*/false, in TEST()
632 TestSetTensorValue<qint8>(DT_QINT8, kMaxInt, /*success=*/false, in TEST()

12345