Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 73 for getElementDtype (0.19 sec)

  1. tensorflow/compiler/mlir/lite/transforms/decompose_hybrid_quantization.cc

          allTypesQuantizedOrInt &=
              (mlir::isa<quant::QuantizedType>(type.getElementType()) ||
               mlir::isa<IntegerType>(type.getElementType()));
        }
    
        for (auto result : op->getResults()) {
          ShapedType type = mlir::cast<ShapedType>(result.getType());
          allTypesFp &= !mlir::isa<quant::QuantizedType>(type.getElementType());
          allTypesQuantizedOrInt &=
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/lite/utils/variables_utils.cc

                   .getType()
                   .cast<ShapedType>()
                   .getElementType()
                   .cast<TF::TensorFlowTypeWithSubtype>()
                   .GetSubtypes()
                   .back();
      }
      return IsSupportedVariableType(type);
    }
    
    bool IsSupportedVariableType(ShapedType type) {
      auto element_type = type.getElementType();
      // Check complex types.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Mon Jun 21 19:32:03 UTC 2021
    - 2.6K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/utils/attribute_utils.cc

    namespace mlir {
    namespace TFL {
    
    FloatAttr ExtractSingleElementAsFloat(ElementsAttr attr) {
      if (attr.getShapedType().getNumElements() != 1 ||
          !mlir::isa<FloatType>(attr.getShapedType().getElementType())) {
        return {};
      }
      return attr.getSplatValue<FloatAttr>();
    }
    
    FloatAttr GetSingleElementAsFloatOrSelf(Attribute attr) {
      if (auto m = mlir::dyn_cast_or_null<ElementsAttr>(attr)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/tfr/passes/rewrite_quantized_io.cc

          if (!returned_type ||
              !returned_type.getElementType().isa<quant::QuantizedType>()) {
            continue;
          }
    
          if (auto returned_op =
                  returned_value.get().getDefiningOp<TFR::CastOp>()) {
            auto new_type = returned_type.clone(returned_type.getElementType()
                                                    .cast<quant::QuantizedType>()
    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/common/ir/QuantOps.cc

          return quantizedType.isCompatibleExpressedType(expressed);
    
        if (auto tensorType = mlir::dyn_cast<TensorType>(expressed))
          return spec == tensorType.getElementType();
    
        if (auto vectorType = mlir::dyn_cast<VectorType>(expressed))
          return spec == vectorType.getElementType();
      }
      return false;
    }
    
    LogicalResult QuantizeRegionOp::verify() {
      // There are specifications for both inputs and outputs.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/lite/quantization/ir/QuantOps.cc

          return quantizedType.isCompatibleExpressedType(expressed);
    
        if (auto tensorType = mlir::dyn_cast<TensorType>(expressed))
          return spec == tensorType.getElementType();
    
        if (auto vectorType = mlir::dyn_cast<VectorType>(expressed))
          return spec == vectorType.getElementType();
      }
      return false;
    }
    
    LogicalResult QuantizeRegionOp::verify() {
      // There are specifications for both inputs and outputs.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/lite/utils/constant_utils.cc

    #include "tsl/platform/statusor.h"
    
    namespace mlir {
    namespace TFL {
    
    absl::StatusOr<TypedAttr> CreateTypedAttr(ShapedType shaped_type, int value) {
      Type element_type = shaped_type.getElementType();
      if (element_type.isF16()) {
        auto floatType = mlir::FloatType::getF16(element_type.getContext());
        auto floatAttr = mlir::FloatAttr::get(floatType, static_cast<float>(value));
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 6.5K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/transforms/reduce_type_precision.cc

        auto const_type = mlir::dyn_cast<ShapedType>(op.getOperand(0).getType());
        auto result_type = mlir::dyn_cast<ShapedType>(op.getResult().getType());
        if (!const_type || !const_type.getElementType().isSignlessInteger(4) ||
            !result_type || !result_type.getElementType().isSignlessInteger(8)) {
          return failure();
        }
    
        auto input_op =
            dyn_cast<arith::ConstantOp>(op.getOperand(0).getDefiningOp());
        if (!input_op) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/utils/side_effect_analysis_util.cc

      return device_attr.str();
    }
    
    void MarkResourceAsReadAndWrite(
        Value value,
        SmallVectorImpl<SideEffects::EffectInstance<MemoryEffects::Effect>>&
            effects) {
      if (value.getType().cast<TensorType>().getElementType().isa<ResourceType>()) {
        effects.emplace_back(MemoryEffects::Read::get(), value,
                             ResourceEffects::Variable::get());
        effects.emplace_back(MemoryEffects::Write::get(), value,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Nov 16 00:33:17 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/constant_fold.cc

          // Ignore types with undefined bit widths.
          if (!tensor_type.getElementType().isIntOrFloat()) continue;
          if (!tensor_type.hasStaticShape()) {
            has_unknown_shape = true;
            return size;
          }
          size += tensor_type.getNumElements() *
                  tensor_type.getElementType().getIntOrFloatBitWidth();
        }
        return size;
      };
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 5.3K bytes
    - Viewed (0)
Back to top