Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for getZeroPoint (0.31 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/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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. tensorflow/compiler/mlir/quantization/tensorflow/passes/quantize_composite_functions.cc

      zero_point = rewriter.create<TF::ConstOp>(
          loc, zero_point_type,
          DenseIntElementsAttr::get(zero_point_type,
                                    {static_cast<int32_t>(qtype.getZeroPoint())}));
      return success(scale && zero_point);
    }
    
    LogicalResult CreateUniformQuantizedPerAxisTypeParams(
        quant::UniformQuantizedPerAxisType qtype, Location loc,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 54.5K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/flatbuffer_import.cc

              new_qtype = mlir::quant::UniformQuantizedType::get(
                  per_tensor.getFlags(), per_tensor.getStorageType(),
                  per_tensor.getExpressedType(), per_tensor.getScale(),
                  per_tensor.getZeroPoint(), per_tensor.getStorageTypeMin() - 1,
                  per_tensor.getStorageTypeMax());
            } else {
              return;  // Should not reach here, as it's already checked.
            }
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 21 18:21:50 UTC 2024
    - 66.8K bytes
    - Viewed (0)
Back to top