Home
last modified time | relevance | path

Searched refs:shaped_type (Results 1 – 20 of 20) sorted by relevance

/external/tensorflow/tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/transforms/
Dlhlo_legalize_to_gpu.cc59 auto shaped_type = result.getType().dyn_cast<ShapedType>(); in matchAndRewrite() local
60 if (!shaped_type || shaped_type.getRank() != 1) { in matchAndRewrite()
63 auto dim_size = shaped_type.getDimSize(0); in matchAndRewrite()
75 auto shaped_type = input.getType().dyn_cast<ShapedType>(); in matchAndRewrite() local
76 if (!shaped_type || !shaped_type.hasStaticShape()) { in matchAndRewrite()
80 shaped_type.getDimSize(reducing_dimension.getSExtValue()); in matchAndRewrite()
Dlegalize_to_linalg.cc1140 auto shaped_type = result_type.cast<ShapedType>(); in matchAndRewrite() local
1142 auto zero_attr = rewriter.getZeroAttr(shaped_type.getElementType()); in matchAndRewrite()
1146 auto init_tensor = GetInitTensor(rewriter, loc, shaped_type, dyn_shape); in matchAndRewrite()
1229 auto shaped_type = result_type.cast<ShapedType>(); in matchAndRewrite() local
1231 rewriter, loc, adaptor.lhs(), adaptor.rhs(), shaped_type); in matchAndRewrite()
1232 auto zero_attr = rewriter.getZeroAttr(shaped_type.getElementType()); in matchAndRewrite()
1234 auto init_tensor = GetInitTensor(rewriter, loc, shaped_type, dyn_shape); in matchAndRewrite()
1349 auto shaped_type = result_type.cast<ShapedType>(); in matchAndRewrite() local
1353 auto init_tensor = GetInitTensor(rewriter, loc, shaped_type, dyn_shape); in matchAndRewrite()
/external/llvm-project/mlir/test/Bindings/Python/
Dir_array_attributes.py39 shaped_type = RankedTensorType.get((2, 3, 4), t)
40 attr = DenseElementsAttr.get_splat(shaped_type, element)
54 shaped_type = RankedTensorType.get((2, 3, 4), t)
55 attr = DenseElementsAttr.get_splat(shaped_type, element)
69 shaped_type = RankedTensorType.get((2, 3, 4), t)
86 attr = DenseElementsAttr.get_splat(shaped_type, other_element)
/external/tensorflow/tensorflow/compiler/mlir/lite/
Dflatbuffer_import.cc351 mlir::RankedTensorType shaped_type, mlir::FloatType elem_type, in ConvertFloatBuffer() argument
374 return DenseElementsAttr::get(shaped_type, values); in ConvertFloatBuffer()
390 return DenseElementsAttr::get(shaped_type, ArrayRef<float>(values)); in ConvertFloatBuffer()
406 return DenseElementsAttr::get(shaped_type, ArrayRef<double>(values)); in ConvertFloatBuffer()
413 mlir::RankedTensorType shaped_type, mlir::Type elem_type, in ConvertIntBuffer() argument
420 shaped_type = mlir::RankedTensorType::get(shaped_type.getShape(), in ConvertIntBuffer()
434 return DenseElementsAttr::get(shaped_type, ArrayRef<bool>(values)); in ConvertIntBuffer()
437 return DenseElementsAttr::get(shaped_type, ArrayRef<uint8_t>(buffer)); in ConvertIntBuffer()
441 return DenseElementsAttr::get(shaped_type, ArrayRef<uint16_t>(values)); in ConvertIntBuffer()
445 return DenseElementsAttr::get(shaped_type, ArrayRef<uint32_t>(values)); in ConvertIntBuffer()
[all …]
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/ir/
Dtf_attributes.cc81 ShapeAttr ShapeAttr::get(mlir::MLIRContext* context, ShapedType shaped_type) { in get() argument
82 if (shaped_type.hasRank()) in get()
83 return Base::get(context, shaped_type.getShape(), /*unranked=*/false); in get()
Dtf_attributes.h49 static ShapeAttr get(mlir::MLIRContext* context, ShapedType shaped_type);
Dtf_types.cc28 auto shaped_type = value.getType().cast<mlir::ShapedType>(); in GetShape() local
29 if (shaped_type.hasRank()) return shaped_type.getShape(); in GetShape()
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/transforms/
Dinit_text_file_to_import_test_pass.cc69 ShapedType shaped_type = in runOnOperation() local
82 op.valueAttr(DenseStringElementsAttr::get(shaped_type, {filename})); in runOnOperation()
Dreadonly_references_to_resources.cc138 ShapedType shaped_type = in runOnFunction() local
140 TensorType tensor_type = DropRefType(shaped_type).cast<TensorType>(); in runOnFunction()
/external/tensorflow/tensorflow/compiler/mlir/lite/utils/
Dconvert_type.cc149 auto shaped_type = type.dyn_cast<mlir::ShapedType>(); in GetShapeStrippedType() local
150 if (shaped_type) { in GetShapeStrippedType()
151 return shaped_type.getElementType(); in GetShapeStrippedType()
Dconstant_utils.cc28 PatternRewriter* rewriter, Location loc, ShapedType shaped_type, in CreateConstOpWithSingleValue() argument
30 Type element_type = shaped_type.getElementType(); in CreateConstOpWithSingleValue()
Dconstant_utils.h31 PatternRewriter* rewriter, Location loc, ShapedType shaped_type, int value);
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/utils/
Dshape_inference_utils.cc354 if (auto shaped_type = in InferReturnTypeComponentsForTFOp() local
356 if (shaped_type.hasRank()) { in InferReturnTypeComponentsForTFOp()
358 ShapedTypeComponents(shaped_type.getShape(), in InferReturnTypeComponentsForTFOp()
359 shaped_type.getElementType()); in InferReturnTypeComponentsForTFOp()
362 ShapedTypeComponents(shaped_type.getElementType()); in InferReturnTypeComponentsForTFOp()
Dexport_utils.cc219 if (auto shaped_type = elt_type.dyn_cast<mlir::ShapedType>()) { in ConvertAttribute() local
220 elt_type = shaped_type.getElementType(); in ConvertAttribute()
414 Status SetShapeAttribute(absl::string_view name, mlir::ShapedType shaped_type, in SetShapeAttribute() argument
418 if (shaped_type.hasRank()) { in SetShapeAttribute()
419 for (auto dim : shaped_type.getShape()) tshape.add_dim()->set_size(dim); in SetShapeAttribute()
/external/tensorflow/tensorflow/compiler/mlir/lite/ir/
Dtfl_ops.cc72 ShapedType shaped_type = in VerifyOperandsHaveSameShapesOrBroadcastableShape() local
74 if (!shaped_type || !shaped_type.hasRank()) { in VerifyOperandsHaveSameShapesOrBroadcastableShape()
79 max_rank = std::max(max_rank, shaped_type.getRank()); in VerifyOperandsHaveSameShapesOrBroadcastableShape()
80 if (!shaped_type.hasStaticShape()) { in VerifyOperandsHaveSameShapesOrBroadcastableShape()
86 ArrayRef<int64_t> shape = shaped_type.getShape(); in VerifyOperandsHaveSameShapesOrBroadcastableShape()
326 if (auto shaped_type = t.dyn_cast_or_null<ShapedType>()) { in IsF32ShapedType() local
327 return shaped_type.getElementType().isF32(); in IsF32ShapedType()
334 if (auto shaped_type = t.dyn_cast_or_null<ShapedType>()) { in IsBF16ShapedType() local
335 return shaped_type.getElementType().isBF16(); in IsBF16ShapedType()
528 if (auto shaped_type = result_type.dyn_cast<RankedTensorType>()) { in buildComparisonBinOp() local
[all …]
/external/tensorflow/tensorflow/compiler/mlir/lite/transforms/
Dlegalize_tf.cc105 auto shaped_type = value.getType().dyn_cast<ShapedType>(); in HasSameStaticShapes() local
106 if (!shaped_type || !shaped_type.hasStaticShape()) { in HasSameStaticShapes()
110 shape = shaped_type.getShape(); in HasSameStaticShapes()
112 if (shape != shaped_type.getShape()) { in HasSameStaticShapes()
Doptimize.cc252 auto shaped_type = type.dyn_cast<ShapedType>(); in GetShapeStrippedType() local
253 if (shaped_type) { in GetShapeStrippedType()
254 return shaped_type.getElementType(); in GetShapeStrippedType()
861 if (auto shaped_type = t.dyn_cast<ShapedType>()) { in CanFuseAffineOp() local
862 element_type = shaped_type.getElementType(); in CanFuseAffineOp()
Dlower_static_tensor_list.cc347 if (auto shaped_type = element_shape.getType().dyn_cast<ShapedType>()) { in matchAndRewrite() local
348 if (shaped_type.getRank() == 0) { in matchAndRewrite()
369 if (auto shaped_type = in matchAndRewrite() local
371 if (shaped_type.hasStaticShape()) { in matchAndRewrite()
373 {shaped_type.getRank()}, rewriter.getIntegerType(32)); in matchAndRewrite()
375 for (int64_t dim : shaped_type.getShape()) { in matchAndRewrite()
/external/tensorflow/tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/IR/
Dhlo_ops.cc1120 auto shaped_type = type.cast<ShapedType>(); in inferReturnTypes() local
1121 if (shaped_type.hasRank()) { in inferReturnTypes()
1122 first_type = shaped_type; in inferReturnTypes()
1733 auto shaped_type = input.getType().cast<ShapedType>(); in fold() local
1735 if (shaped_type.getDimSize(dim.getLimitedValue()) != 1) { in fold()
2143 auto shaped_type = getType().cast<ShapedType>(); in fold() local
2144 if (!shaped_type.hasStaticShape()) return {}; in fold()
2158 return DenseFPElementsAttr::get(shaped_type, values); in fold()
/external/tensorflow/tensorflow/compiler/mlir/xla/transforms/
Dlegalize_tf.cc818 auto shaped_type = int_attr.getType(); in SliceDenseIntElementsAttrColumn2D() local
819 auto shape = shaped_type.getShape(); in SliceDenseIntElementsAttrColumn2D()
824 values.reserve(shaped_type.getNumElements() / shape[1]); in SliceDenseIntElementsAttrColumn2D()