Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for getStorageType (0.49 sec)

  1. tensorflow/compiler/mlir/lite/quantization/ir/QuantizeUtils.cc

      if (mlir::isa<FloatAttr>(origRealValue)) {
        FloatAttr floatAttr = mlir::cast<FloatAttr>(origRealValue);
        outConvertedType = quantizedElementType.getStorageType();
        return IntegerAttr::get(quantizedElementType.getStorageType(),
                                converter.quantizeFloatToInt(floatAttr.getValue()));
      }
    
      return nullptr;
    }
    
    /// Converts a real expressed DenseFPElementsAttr to a corresponding
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/common/uniform_quantized_types_test.cc

                                          /*scale=*/1.0, /*zero_point=*/0);
      // Storage type of `i8` is currently verifiable as `unsigned` in `Types.cpp`.
      EXPECT_TRUE(quantized_type.getStorageType().isSignlessInteger(8));
    }
    
    TEST_F(CreateI8F32UniformQuantizedTypeTest, F32ExpressedTypeSucceeds) {
      const UniformQuantizedType quantized_type =
          CreateI8F32UniformQuantizedType(UnknownLoc::get(&ctx_), 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)
  3. tensorflow/compiler/mlir/lite/quantization/ir/QuantizeUtils.h

    }  // namespace quant
    namespace quantfork {
    class UniformQuantizedValueConverter;
    
    /// Converts an attribute from a type based on
    /// quantizedElementType.getExpressedType() to one based on
    /// quantizedElementType.getStorageType(), where quantizedElementType is as from
    /// QuantizedType::getQuantizedElementType().
    /// Returns nullptr if the conversion is not supported. On success, stores the
    /// converted type in outConvertedType.
    ///
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Jul 29 18:55:28 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tfr/passes/rewrite_quantized_io.cc

                                    .dyn_cast<quant::QuantizedType>()) {
            if (arg.hasOneUse() && llvm::isa<TFR::CastOp>(*arg.user_begin())) {
              arg.setType(
                  arg_type.cast<TensorType>().clone(quant_type.getStorageType()));
            } else {
              std::string error_message;
              llvm::raw_string_ostream os{error_message};
              os << "The argument with type ";
              arg.getType().print(os);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Jun 08 01:19:25 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/quantization/tensorflow/passes/prepare_lifting.cc

        if (multiplier_attr.isSplat()) {
          double new_scale = multiplier_array.front() * uniform_type.getScale();
          new_qtype = UniformQuantizedType::get(
              uniform_type.getFlags(), uniform_type.getStorageType(),
              uniform_type.getExpressedType(), new_scale,
              uniform_type.getZeroPoint(), uniform_type.getStorageTypeMin(),
              uniform_type.getStorageTypeMax());
        } else {
          auto new_scales =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/quantization/common/quantization_lib/quantization_utils.cc

              llvm::equal(expected_per_axis_qtype.getZeroPoints(),
                          compared_per_axis_qtype.getZeroPoints()) &&
              expected_params.getStorageType() ==
                  compared_params.getStorageType() &&
              expected_params.getExpressedType() ==
                  compared_params.getExpressedType()) {
            continue;
          }
        }
    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/quantization/common/uniform_quantized_types.cc

    }
    
    bool IsStorageTypeI8(const QuantizedType quantized_type) {
      const Type storage_type = quantized_type.getStorageType();
      return storage_type.isInteger(/*width=*/8);
    }
    
    bool IsStorageTypeI32(const QuantizedType quantized_type) {
      const Type storage_type = quantized_type.getStorageType();
      return storage_type.isInteger(/*width=*/32);
    }
    
    bool IsExpressedTypeF32(const QuantizedType quantized_type) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/quantization/common/ir/UniformSupport.h

                uniform_type.getStorageTypeIntegralWidth(),
                uniform_type.isSigned()) {
        assert(isa<FloatType>(uniform_type.getExpressedType()));
        assert(uniform_type.getStorageType().isSignlessInteger());
      }
    
      UniformQuantizedValueConverter(double scale, double zero_point,
                                     double clamp_min, double clamp_max,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed May 08 02:10:16 UTC 2024
    - 9.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/quantization/stablehlo/passes/bridge/convert_tf_quant_ops_to_mhlo.cc

        rewriter.replaceOpWithNewOp<mhlo::BitcastConvertOp>(
            op,
            output_type->clone(
                mlir::dyn_cast<quant::QuantizedType>(output_type->getElementType())
                    .getStorageType()),
            result);
    
        return success();
      }
    };
    
    // UniformDequantizeOp takes TF quantized types as input which would have been
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri May 17 17:58:54 UTC 2024
    - 30.9K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/lite/stablehlo/transforms/op_stat_pass.cc

                  auto uniform_quantized_dtype =
                      mlir::dyn_cast_or_null<UniformQuantizedType>(
                          operand_or_result)
                          .getStorageType();
                  dtype = absl::StrCat(
                      "uq_", uniform_quantized_dtype.getIntOrFloatBitWidth());
                })
                .Case<quant::UniformQuantizedPerAxisType>([&](Type) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.7K bytes
    - Viewed (0)
Back to top