Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 133 for ShapedType (0.51 sec)

  1. tensorflow/compiler/mlir/lite/utils/constant_utils.cc

      }
    }
    
    // Returns a Constant op with a splat vector value.
    absl::StatusOr<arith::ConstantOp> CreateConstOpWithVectorValue(
        PatternRewriter* rewriter, Location loc, ShapedType shaped_type,
        int value) {
      ShapedType dense_type = RankedTensorType::get(shaped_type.getShape(),
                                                    shaped_type.getElementType());
      auto attr = CreateTypedAttr(dense_type, 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)
  2. tensorflow/compiler/mlir/quantization/tensorflow/passes/convert_tf_xla_op_to_tf_op.cc

      dot_dimension_numbers.ParseFromString(dot_dimension_numbers_str.str());
      SmallVector<Value> input_arguments = {lhs, rhs};
      const int lhs_rank = mlir::cast<ShapedType>(lhs.getType()).getShape().size();
      const int rhs_rank = mlir::cast<ShapedType>(rhs.getType()).getShape().size();
    
      const std::string einsum_equation =
          CreateEinsumEquation(dot_dimension_numbers, lhs_rank, rhs_rank);
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/stablehlo/transforms/fold_broadcast_pass.cc

      auto lhs = dyn_cast_or_null<DenseElementsAttr>(lhs_op.getValue());
      auto rhs = dyn_cast_or_null<DenseElementsAttr>(rhs_op.getValue());
      if (!lhs || !rhs) return {};
    
      ShapedType type = mlir::cast<ShapedType>(op->getType());
      if (!type.hasStaticShape()) {
        return {};
      }
    
      Type etype = type.getElementType();
    
      // Evaluate for element types.
      if (!mlir::isa<ElementType>(etype)) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  4. tensorflow/compiler/mlir/lite/transforms/optimize_patterns.td

      CPred<"IsLastDimensionEqualOne($0) || "
            "(!$0.getType().cast<ShapedType>().hasStaticShape() && "
            "  $0.getType().cast<ShapedType>().hasRank() && "
            "  $0.getType().cast<ShapedType>().getRank() == 2 && "
            "  !$0.getType().cast<ShapedType>().getShape().empty() && "
            "  $0.getType().cast<ShapedType>().getShape()[1] == 1)">>;
    
    // Replace
    //   Equal(X, indices)
    // With
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 16 20:31:41 UTC 2024
    - 66.4K bytes
    - Viewed (0)
  5. tensorflow/compiler/mlir/lite/utils/constant_utils.h

    absl::StatusOr<arith::ConstantOp> CreateConstOpWithSingleValue(
        PatternRewriter* rewriter, Location loc, ShapedType shaped_type, int value);
    
    // Returns a Constant op with a splat vector value.
    absl::StatusOr<arith::ConstantOp> CreateConstOpWithVectorValue(
        PatternRewriter* rewriter, Location loc, ShapedType shaped_type, int value);
    
    }  // namespace TFL
    }  // namespace mlir
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Feb 27 06:24:28 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  6. tensorflow/compiler/mlir/tensorflow/utils/export_utils.h

    //   bool hasRank()
    //   ArrayRef<int64_t> getShape()
    // This includes mlir::TF::ShapeAttr and mlir::ShapedType.
    template <typename ShapeContainerT>
    void SetTensorShapeProto(ShapeContainerT shape, TensorShapeProto* proto) {
      if (shape.hasRank()) {
        for (int64_t dim : shape.getShape()) {
          proto->add_dim()->set_size(mlir::ShapedType::isDynamic(dim) ? -1 : dim);
        }
      } else {
        proto->set_unknown_rank(true);
      }
    }
    
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  7. tensorflow/compiler/mlir/quantization/stablehlo/passes/quantize_weight.cc

      QuantizationUnits GetQuantizableOps(ConstantOp op) const {
        // Non-float tensors do not need quantization.
        QuantizationUnits quantizable_ops;
        const ShapedType type = mlir::dyn_cast<ShapedType>(op.getType());
        if (!type || !type.getElementType().isF32()) return quantizable_ops;
    
        const Value value = op.getResult();
    
        for (OpOperand& use : value.getUses()) {
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tensorflow/ir/tf_ops_n_z.cc

        return op.emitOpError("requires scalar output");
    
      return success();
    }
    
    OpFoldResult SizeOp::fold(FoldAdaptor) {
      ShapedType output_type = getType().cast<ShapedType>();
      if (!output_type.hasRank()) return {};
      ShapedType input_type = getOperand().getType().cast<ShapedType>();
      if (!input_type.hasStaticShape()) return {};
      int size = input_type.getNumElements();
      return DenseElementsAttr::get(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 09 22:07:10 UTC 2024
    - 170.8K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tensorflow/utils/convert_type.cc

    #include "tensorflow/core/framework/types.h"
    #include "tensorflow/core/framework/types.pb.h"
    #include "tensorflow/core/lib/core/errors.h"
    
    namespace tensorflow {
    
    using mlir::Builder;
    using mlir::ShapedType;
    using mlir::Type;
    
    Status ConvertDataType(DataType dtype, Builder builder, Type* type) {
      switch (dtype) {
        case DT_HALF:
          *type = builder.getF16Type();
          return absl::OkStatus();
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Fri Apr 26 09:37:10 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  10. tensorflow/compiler/mlir/tensorflow/ir/tf_traits.h

            element_type) {
          return op->emitOpError(
              "requires compatible element types for all operands and results");
        }
      }
      return success();
    }
    
    inline ShapedType MergeType(ShapedType a, ShapedType b) {
      if (!a.hasRank()) {
        return b;
      }
      if (!b.hasRank()) {
        return a;
      }
      int64_t rank = a.getRank();
      SmallVector<int64_t, 4> dims;
      dims.resize(rank);
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Apr 25 16:01:03 UTC 2024
    - 12.7K bytes
    - Viewed (0)
Back to top