Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for getZeroPoint (0.43 sec)

  1. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_lifting.cc

      auto qtype =
          mlir::cast<TensorType>(dq_op.getArg().getType()).getElementType();
      if (auto uniform_type = llvm::dyn_cast_or_null<UniformQuantizedType>(qtype)) {
        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(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/quantization/device_target.cc

      // output ranges
      auto min = rop->getAttrOfType<FloatAttr>("min");
      auto max = rop->getAttrOfType<FloatAttr>("max");
      output_ranges->push_back(CalculateQuantizedRange(
          o_spec.getScale(), o_spec.getZeroPoint(),
          (min ? std::optional<double>(min.getValueAsDouble()) : std::nullopt),
          (max ? std::optional<double>(max.getValueAsDouble()) : std::nullopt),
          o_spec.getStorageTypeMin(), o_spec.getStorageTypeMax()));
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Mar 08 10:41:08 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/quantization/common/uniform_quantized_types_test.cc

          CreateI8F32UniformQuantizedType(UnknownLoc::get(&ctx_), ctx_,
                                          /*scale=*/8.0, /*zero_point=*/99);
    
      EXPECT_EQ(quantized_type.getScale(), 8.0);
      EXPECT_EQ(quantized_type.getZeroPoint(), 99);
    }
    
    class CreateI32F32UniformQuantizedTypeTest : public Test {
     protected:
      CreateI32F32UniformQuantizedTypeTest() : ctx_() {
        ctx_.loadDialect<quant::QuantizationDialect>();
      }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 28.8K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/experimental/tac/transforms/device_transform.cc

        auto q_type = mlir::dyn_cast_or_null<quant::UniformQuantizedType>(
            input_type.getElementType());
        if (!q_type) return failure();
    
        const float scale = q_type.getScale();
        const float zp = q_type.getZeroPoint();
    
        auto input_values = input_dequant.getValue();
    
        // mapValues always takes a function returning APInt, even when the output
        // is actually float.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/common/ir/UniformSupport.h

     public:
      explicit UniformQuantizedValueConverter(
          quant::UniformQuantizedType uniform_type)
          : UniformQuantizedValueConverter(
                uniform_type.getScale(),
                static_cast<double>(uniform_type.getZeroPoint()),
                static_cast<double>(uniform_type.getStorageTypeMin()),
                static_cast<double>(uniform_type.getStorageTypeMax()),
                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/quantization/common/quantization_lib/quantization_utils.cc

      };
      if (auto q_type = dyn_cast<UniformQuantizedType>(type)) {
        const double scale = recalculate_scale(q_type.getScale());
        const double zero_point = recalculate_zero_point(q_type.getZeroPoint());
        return UniformQuantizedType::get(q_type.getFlags(), q_type.getStorageType(),
                                         q_type.getExpressedType(), scale,
                                         zero_point, qmin, qmax);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 43.2K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/stablehlo/transforms/uniform_quantized_stablehlo_to_tfl_pass.cc

        new_filter_quantized_type = CreateI8F32UniformQuantizedType(
            filter_constant_op->getLoc(), *rewriter.getContext(),
            filter_quantized_type.getScale(), filter_quantized_type.getZeroPoint(),
            /*narrow_range=*/true);
      }
    
      // Required because the quantized dimension is changed from 3 -> 0.
      auto new_filter_result_type = RankedTensorType::getChecked(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Apr 22 09:00:19 UTC 2024
    - 99.8K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/transforms/prepare_quantize_helper.h

          return quant::UniformQuantizedType::get(
              qtype.getFlags(), qtype.getStorageType(), qtype.getExpressedType(),
              qtype.getScale() * scale, qtype.getZeroPoint(),
              qtype.getStorageTypeMin(), qtype.getStorageTypeMax());
        }
        return {};
      };
    }
    
    // Returns quantization spec for LSTMs based on their operator properties.
    template <typename LstmOp>
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 03 18:01:23 UTC 2024
    - 28K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tfr/ir/tfr_ops.cc

              rewriter.getF32FloatAttr(qtype.getScale()));
          zp_op = rewriter.create<TF::ConstOp>(
              loc, RankedTensorType::get({}, rewriter.getI32Type()),
              rewriter.getI32IntegerAttr(qtype.getZeroPoint()));
        } else if (auto qtype =
                       cast_qtype.dyn_cast<quant::UniformQuantizedPerAxisType>()) {
          SmallVector<float> scales(qtype.getScales().begin(),
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Nov 21 16:55:41 UTC 2023
    - 38.2K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.h

          new_qtype = quant::UniformQuantizedType::getChecked(
              op.getLoc(), flags, qtype.getStorageType(), qtype.getExpressedType(),
              uqtype.getScale(), uqtype.getZeroPoint() - offset,
              uqtype.getStorageTypeMin() - offset,
              uqtype.getStorageTypeMax() - offset);
        } else if (auto aqtype = qtype.template dyn_cast<
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Apr 24 20:30:06 UTC 2024
    - 41.7K bytes
    - Viewed (0)
Back to top