- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 113 for ShapedType (0.35 sec)
-
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) -
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) -
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) -
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) -
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) -
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) -
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) -
tensorflow/compiler/mlir/lite/transforms/reduce_type_precision.cc
LogicalResult matchAndRewrite(TFL::GatherOp op, PatternRewriter &rewriter) const override { 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)) {
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/tensorflow/transforms/constant_fold.cc
// TODO(hinsu): Handle ops that have one of the results empty for constant // propagation. bool has_empty_numerical_results = llvm::all_of(inst->getResultTypes(), [](Type ty) { ShapedType shaped_ty = mlir::cast<ShapedType>(ty); Type element_ty = shaped_ty.getElementType(); return shaped_ty.hasStaticShape() && shaped_ty.getNumElements() == 0 && element_ty.isIntOrFloat(); });
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 5.3K bytes - Viewed (0) -
tensorflow/compiler/mlir/quantization/tensorflow/utils/tf_to_xla_attribute_utils_test.cc
Value packed_value = PackOperand(builder, module->getLoc(), value, pack_dim); DenseIntElementsAttr packed_value_attr; ASSERT_TRUE(matchPattern(packed_value, m_Constant(&packed_value_attr))); ShapedType packed_shape_type = mlir::dyn_cast<ShapedType>(packed_value.getType()); llvm::SmallVector<int64_t> packed_shape(packed_shape_type.getShape().begin(), packed_shape_type.getShape().end());
Registered: Sun Jun 16 05:45:23 UTC 2024 - Last Modified: Thu Apr 25 16:01:03 UTC 2024 - 3.5K bytes - Viewed (0)