/external/tensorflow/tensorflow/compiler/mlir/xla/tests/ |
D | legalize-tf-types.mlir | 3 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/ |
D | mkl_qmatmul_op.cc | 309 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 …]
|
D | mkl_conv_ops.cc | 1344 : 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 …]
|
D | mkl_quantized_conv_ops_test.cc | 88 .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 …]
|
D | mkl_requantize_per_channel_op.cc | 107 ? 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>);
|
D | mkl_quantized_conv_ops_perchannel_test.cc | 89 .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()
|
D | mkl_qmatmul_op_test.cc | 100 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/ |
D | relu_op.cc | 144 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 …]
|
D | quantize_op_test.cc | 171 .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 …]
|
D | dequantize_op_test.cc | 193 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()
|
D | maxpooling_op.h | 43 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,
|
D | quantized_bias_add_op.cc | 102 .TypeConstraint<qint8>("T1") 103 .TypeConstraint<qint8>("T2") 105 QuantizedBiasAddOp<qint8, qint8, qint32>);
|
D | save_v2_op_test.cc | 90 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()
|
D | save_op_test.cc | 93 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()
|
D | quantized_pooling_ops.cc | 142 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>);
|
D | restore_v2_op_test.cc | 146 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()
|
D | gather_nd_op_test.cc | 100 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()
|
D | restore_op_test.cc | 128 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()
|
D | relu_op_gpu.cu.cc | 217 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>;
|
D | depthtospace_op.cc | 70 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>);
|
D | dequantize_op.cc | 237 .TypeConstraint<qint8>("T") 239 DequantizeOp<CPUDevice, qint8, float>); 263 .TypeConstraint<qint8>("T") 265 DequantizeOp<CPUDevice, qint8, bfloat16>);
|
/external/tensorflow/tensorflow/python/ops/ |
D | dequantize_op_test.py | 45 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/ |
D | spacetodepth_op_test.py | 234 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/ |
D | type_traits.h | 41 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/ |
D | utils_test.cc | 623 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()
|