Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for getZeroPoints (0.41 sec)

  1. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.cc

      SmallVector<double, 4> scales(qtype.getScales().begin(),
                                    qtype.getScales().end());
      SmallVector<int64_t, 4> zero_points(qtype.getZeroPoints().begin(),
                                          qtype.getZeroPoints().end());
    
      if (new_shape.size() == shape.size()) {  // same rank
        // Broadcast the scales and zero points to match the target size, which is
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 43.2K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/stablehlo/passes/bridge/convert_tf_quant_ops_to_mhlo.cc

                                    PatternRewriter &rewriter) const override {
        auto output_type = GetUniformQuantizedType(
            op, op.getOutput().getType(), op.getScales(), op.getZeroPoints(),
            /*expressed_type=*/rewriter.getF32Type(), op.getQuantizationMinVal(),
            op.getQuantizationMaxVal(), op.getQuantizationAxis(), rewriter);
        if (failed(output_type)) {
          return failure();
        }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 30.9K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_lifting.cc

        return uniform_type.getZeroPoint() == 0;
      } else if (auto per_axis_type =
                     llvm::dyn_cast_or_null<UniformQuantizedPerAxisType>(qtype)) {
        return absl::c_all_of(per_axis_type.getZeroPoints(),
                              [](int64_t x) { return x == 0; });
      }
      return false;
    }
    
    // Multiplies two 1D arrays with broadcasting support.
    template <typename T>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/common/uniform_quantized_types_test.cc

              /*zero_points=*/SmallVector<int64_t, 2>{98, 99},
              /*quantization_dimension=*/0);
    
      EXPECT_THAT(quantized_type.getScales(), ElementsAreArray({8.0, 9.0}));
      EXPECT_THAT(quantized_type.getZeroPoints(), ElementsAreArray({98, 99}));
    }
    
    class CreateI32F32UniformQuantizedPerAxisTypeTest : public Test {
     protected:
      CreateI32F32UniformQuantizedPerAxisTypeTest() : ctx_() {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 28.8K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/common/ir/UniformSupport.h

     public:
      explicit UniformQuantizedPerAxisValueConverter(
          quant::UniformQuantizedPerAxisType uniform_type)
          : scales_(uniform_type.getScales()),
            zero_points_(uniform_type.getZeroPoints()),
            clamp_min_(static_cast<double>(uniform_type.getStorageTypeMin())),
            clamp_max_(static_cast<double>(uniform_type.getStorageTypeMax())),
            storage_bit_width_(uniform_type.getStorageTypeIntegralWidth()),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/stablehlo/transforms/uniform_quantized_stablehlo_to_tfl_pass.cc

        new_filter_quantized_type = CreateI8F32UniformQuantizedPerAxisType(
            filter_constant_op->getLoc(), *rewriter.getContext(),
            filter_quantized_type.getScales(),
            filter_quantized_type.getZeroPoints(),
            /*quantization_dimension=*/0, /*narrow_range=*/true);
      } else {
        auto filter_quantized_type = GetElementType(filter_constant_op.getResult())
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 09:00:19 UTC 2024
    - 99.8K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/tfr/ir/tfr_ops.cc

          SmallVector<float> scales(qtype.getScales().begin(),
                                    qtype.getScales().end());
          SmallVector<int32_t> zps(qtype.getZeroPoints().begin(),
                                   qtype.getZeroPoints().end());
          const size_t num_channels = qtype.getScales().size();
    
          auto scales_type = RankedTensorType::get(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Nov 21 16:55:41 UTC 2023
    - 38.2K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_driver.cc

            quant::UniformQuantizedPerAxisType::getChecked(
                bias_op->getLoc(), params.getFlags(), params.getStorageType(),
                params.getExpressedType(), new_bias_scales,
                bias_quantized_type.getZeroPoints(),
                bias_quantized_type.getQuantizedDimension(),
                params.getStorageTypeMin(), params.getStorageTypeMax()));
    
        arith::ConstantOp filter_op = DuplicateConstantOpIfNeeded(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 38.1K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_helper.h

        auto new_qtype = quant::CreateI8F32UniformQuantizedPerAxisType(
            transpose_op.getLoc(), *rewriter.getContext(), aqtype.getScales(),
            aqtype.getZeroPoints(), new_out_quant_dim, /*narrow_range=*/true);
        auto new_tensor_type = RankedTensorType::getChecked(
            transpose_op.getLoc(), transpose_op.getType().getShape(), new_qtype);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 18:01:23 UTC 2024
    - 28K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/quantization/stablehlo/passes/quantization_patterns.cc

        }
    
        const ArrayRef<int64_t> zero_points =
            mlir::cast<UniformQuantizedPerAxisType>(
                getElementTypeOrSelf(filter_type))
                .getZeroPoints();
    
        // `stablehlo.convolution` assumes the following format:
        // [b, 0, 1, f]x[0, 1, i, o]->[b, 0, 1, f]
        // `stablehlo.dot_general` can take various formats. We only per-channel
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 06:04:36 UTC 2024
    - 41.7K bytes
    - Viewed (0)
Back to top