Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for getIntOrFloatBitWidth (0.45 sec)

  1. tensorflow/compiler/mlir/lite/stablehlo/transforms/op_stat_pass.cc

                .Case<IntegerType>([&](Type) {
                  dtype =
                      absl::StrCat("i", operand_or_result.getIntOrFloatBitWidth());
                })
                .Case<FloatType>([&](Type) {
                  dtype =
                      absl::StrCat("f", operand_or_result.getIntOrFloatBitWidth());
                })
                .Case<UniformQuantizedType>([&](Type) {
                  auto uniform_quantized_dtype =
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  2. tensorflow/compiler/mlir/quantization/stablehlo/utils/bfloat16_type.cc

    #include "mlir/Support/LLVM.h"  // from @llvm-project
    
    namespace mlir::quant::stablehlo {
    
    bool IsLargeFloatType(Type type) {
      type = getElementTypeOrSelf(type);
      return isa<FloatType>(type) && type.getIntOrFloatBitWidth() > 16;
    }
    
    Type ToBfloat16Type(Type type) {
      if (auto shaped = mlir::dyn_cast<ShapedType>(type)) {
        const Type elem = shaped.getElementType();
        if (IsLargeFloatType(elem)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/utils/const_tensor_utils.cc

      // Since we don't know which ones are weights, we represent this optimization
      // as a change in the storage bounds for the type for all constants of this
      // type.
      const int bitwidth = storage_type.getIntOrFloatBitWidth();
      const bool is_weight_buffer = is_constant && (bitwidth == 8);
    
      int64_t storage_min =
          QuantizedType::getDefaultMinimumForInteger(is_signed, bitwidth) +
          static_cast<int>(is_weight_buffer);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 07 23:04:40 UTC 2024
    - 16.6K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/quantization/tensorflow/cc/const_op_size.cc

    int64_t GetSizeOfIntOrFloatConst(TF::ConstOp const_op) {
      const Type dtype = const_op.getDtype();
      const ElementsAttr const_value = const_op.getValue();
    
      const auto bytes_per_elem =
          static_cast<int64_t>(dtype.getIntOrFloatBitWidth() / CHAR_BIT);
    
      return bytes_per_elem * const_value.getNumElements();
    }
    
    int64_t GetSizeOfStringConst(TF::ConstOp const_op) {
      const ElementsAttr const_value = const_op.getValue();
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Wed Dec 14 04:37:13 UTC 2022
    - 2.7K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/transforms/modify_io_nodes.cc

            new_arg = block.addArgument(arg_type, loc);
            quantize_output.replaceAllUsesWith(new_arg);
          } else if (input_type.isUnsignedInteger(
                         current_type.getIntOrFloatBitWidth())) {  // int8 != uint8
            arg_type = quant::ConvertSignedQuantizedToUnsigned(
                quantize_output.getType(), loc);
            new_arg = block.addArgument(arg_type, loc);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/transforms/constant_fold.cc

          if (!tensor_type.hasStaticShape()) {
            has_unknown_shape = true;
            return size;
          }
          size += tensor_type.getNumElements() *
                  tensor_type.getElementType().getIntOrFloatBitWidth();
        }
        return size;
      };
    
      int64_t results_size = get_size(inst->getResultTypes());
      int64_t operands_size = get_size(inst->getOperandTypes());
    
      constexpr int kSizeFactor = 2;
    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/tensorflow/transforms/host_runtime/tpu_variable_runtime_reformatting.cc

        if (subtypes.size() != 1) continue;
        auto data_type = getElementTypeOrSelf(subtypes[0]);
        // The XLA backend does not yet support formatting 64-bit data types.
        if (data_type.getIntOrFloatBitWidth() == 64) continue;
    
        const auto& block_arg = replicate.GetBody().getArgument(replicate_arg);
    
        int64_t num_inputs = 0;
        if (replicate.IsReplicatedBlockArgument(block_arg)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 21.9K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/lite/flatbuffer_import.cc

          builder.getContext(), tensor.sparsity->traversal_order,
          tensor.sparsity->block_map, dim_metadata);
    
      std::vector<char> dense_buffer(
          value_type.getElementType().getIntOrFloatBitWidth() / CHAR_BIT);
      mlir::TypedAttr dummy_value =
          mlir::DenseIntOrFPElementsAttr::getFromRawBuffer(value_type,
                                                           dense_buffer);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue May 21 18:21:50 UTC 2024
    - 66.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_n_z.cc

      return DenseElementsAttr::get(result_type, dimensions);
    }
    
    OpFoldResult ShapeOp::fold(FoldAdaptor) {
      int width =
          getType().cast<ShapedType>().getElementType().getIntOrFloatBitWidth();
      return ConvertShapeToAttr(getOperand().getType(), width);
    }
    
    void ShapeOp::build(OpBuilder &builder, OperationState &result, Value input,
                        BoolAttr use32Bit) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 22:07:10 UTC 2024
    - 170.8K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/transforms/tensor_list_ops_decomposition.cc

      auto result = cutil::GetR1Const(
          mlir::cast<RankedTensorType>(buffer.getType()).getShape().drop_front(),
          OpBuilder(elem_shape), elem_shape.getLoc(),
          elem_shape.getShapeType().getIntOrFloatBitWidth());
      elem_shape.getElementShape().replaceAllUsesWith(result);
      elem_shape.erase();
      return success();
    }
    
    LogicalResult HandleTensorListGatherOp(
        TF::TensorListGatherOp gather,
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 39.2K bytes
    - Viewed (0)
Back to top