- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 30 for constant_ops (0.29 sec)
-
tensorflow/compiler/mlir/quantization/stablehlo/utils/stablehlo_type_utils_test.cc
const OwningOpRef<mlir::stablehlo::ConstantOp> constant_op = builder_.create<mlir::stablehlo::ConstantOp>( builder_.getUnknownLoc(), builder_.getI32IntegerAttr(0)); EXPECT_TRUE(IsStablehloOp(*constant_op)); } TEST_F(StablehloTypeUtilsTest, IsStablehloOpFailsWithArithOp) { const OwningOpRef<mlir::arith::ConstantOp> constant_op = builder_.create<mlir::arith::ConstantOp>(builder_.getUnknownLoc(),
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Mon Mar 25 00:32:20 UTC 2024 - 2.1K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/stablehlo/passes/prepare_quantize.cc
return success(); } }; class ConvertArithConstToStablehloConstOp : public OpRewritePattern<arith::ConstantOp> { public: using OpRewritePattern::OpRewritePattern; LogicalResult matchAndRewrite(arith::ConstantOp op, PatternRewriter& rewriter) const override { rewriter.replaceOpWithNewOp<mlir::stablehlo::ConstantOp>(op, op.getValue());
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed Apr 03 05:11:03 UTC 2024 - 8.1K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/unfold_large_splat_constant.cc
mlir::OpBuilder op_builder(&module.getBodyRegion()); module.walk([&](mlir::arith::ConstantOp const_op) { MaybeUnfoldLargeSplatConstant(&op_builder, const_op); }); } private: void MaybeUnfoldLargeSplatConstant(mlir::OpBuilder* op_builder, mlir::arith::ConstantOp const_op) const { auto splat_elements_attr =
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 4.5K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/transforms/reduce_type_precision.cc
// This pattern checks if an i8 arith::ConstantOp tensor has all values within // the INT4 range, i.e. [-8,7] and converts it into i4 if so. This assumes that // the input is sign-extended two's complement. class CheckRangeAndConvertI8ToI4 : public OpRewritePattern<arith::ConstantOp> { public: using OpRewritePattern<arith::ConstantOp>::OpRewritePattern; LogicalResult matchAndRewrite(arith::ConstantOp 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) -
tensorflow/compiler/mlir/lite/stablehlo/transforms/fuse_convolution_pass.cc
// Variables for capturing values and attributes used while creating ops. mhlo::ConvolutionOp conv_op; Operation *bcast_or_const_op; shape::ShapeOfOp shape_of_op; mhlo::ConstantOp filter; mhlo::ConstantOp multiplier; mlir::ElementsAttr filter_value, mul_value; mlir::DenseIntElementsAttr broadcast_dims; // Match and capture values/attributes. Value lhs = mul_op.getLhs();
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Feb 22 22:21:19 UTC 2024 - 8.3K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/stablehlo/transforms/unfold_splat_constant_pass.cc
// Cannot use the pattern rewriter because the driver applies folders by // default. module.walk([&](mhlo::ConstantOp const_op) { UnfoldSplatConstant(&op_builder, const_op); }); } private: void UnfoldSplatConstant(mlir::OpBuilder* op_builder, mhlo::ConstantOp const_op) const { auto splat_elements_attr = mlir::dyn_cast<SplatElementsAttr>(const_op.getValue());
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 3.8K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/utils/constant_utils.cc
auto attr = CreateTypedAttr(dense_type, value); return rewriter->create<arith::ConstantOp>(loc, dense_type, cast<TypedAttr>(*attr)); } absl::StatusOr<arith::ConstantOp> CreateConstOpWithSingleValue( PatternRewriter* rewriter, Location loc, ShapedType shaped_type, int value) { ShapedType scalar_type =
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 6.5K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/experimental/tac/transforms/fold_constants_to_subgraph.cc
.replaceAllUsesWith(cloned_const_op->getResult(0)); } bool IsConstOrQConstInt(Operation* op) { if (!llvm::isa<TFL::ConstOp, TFL::QConstOp, arith::ConstantOp>(op)) return false; if (auto arith_const_op = dyn_cast_or_null<arith::ConstantOp>(op)) { // arith ConstOp path. auto type = mlir::cast<ShapedType>(arith_const_op.getType()).getElementType();
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 6.1K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/utils/constant_utils.h
namespace mlir { namespace TFL { // Returns a Constant op with a single value. 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);
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Tue Feb 27 06:24:28 UTC 2024 - 1.7K bytes - Viewed (0) -
tensorflow/compiler/mlir/lite/stablehlo/odml_converter/folders.cc
static std::optional<FoldAdaptor> Create(Operation* operation) { auto foldable_opr = [](Value val) -> bool { return !llvm::isa<BlockArgument>(val) && llvm::isa<stablehlo::ConstantOp>(val.getDefiningOp()); }; if (!llvm::all_of(operation->getOperands(), foldable_opr)) { return std::nullopt; } return FoldAdaptor(operation); }
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Wed May 08 06:11:55 UTC 2024 - 4.5K bytes - Viewed (0)