/external/llvm-project/mlir/test/Bindings/Python/ |
D | ir_array_attributes.py | 23 attr = DenseElementsAttr.get(array) 40 attr = DenseElementsAttr.get_splat(shaped_type, element) 55 attr = DenseElementsAttr.get_splat(shaped_type, element) 74 attr = DenseElementsAttr.get_splat(non_shaped_type, element) 80 attr = DenseElementsAttr.get_splat(dynamic_shaped_type, element) 86 attr = DenseElementsAttr.get_splat(shaped_type, other_element) 104 attr = DenseElementsAttr.get(array) 120 attr = DenseElementsAttr.get(array) 135 attr = DenseElementsAttr.get(array) 149 attr = DenseElementsAttr.get(array) [all …]
|
/external/llvm-project/mlir/unittests/IR/ |
D | AttributeTest.cpp | 22 DenseElementsAttr splat = DenseElementsAttr::get(shape, splatElt); in testSplat() 26 DenseElementsAttr::get(shape, llvm::makeArrayRef({splatElt, splatElt})); in testSplat() 41 DenseElementsAttr trueSplat = DenseElementsAttr::get(shape, true); in TEST() 44 DenseElementsAttr falseSplat = DenseElementsAttr::get(shape, false); in TEST() 50 auto detectedSplat = DenseElementsAttr::get(shape, {true, true, true, true}); in TEST() 53 detectedSplat = DenseElementsAttr::get(shape, {false, false, false, false}); in TEST() 66 DenseElementsAttr trueSplat = DenseElementsAttr::get(shape, true); in TEST() 67 DenseElementsAttr falseSplat = DenseElementsAttr::get(shape, false); in TEST() 74 auto detectedSplat = DenseElementsAttr::get(shape, trueValues); in TEST() 78 detectedSplat = DenseElementsAttr::get(shape, falseValues); in TEST() [all …]
|
/external/llvm-project/mlir/lib/CAPI/IR/ |
D | BuiltinAttributes.cpp | 311 return unwrap(attr).isa<DenseElementsAttr>(); in mlirAttributeIsADenseElements() 328 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), in mlirDenseElementsAttrGet() 334 return wrap(DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), in mlirDenseElementsAttrSplatGet() 340 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrBoolSplatGet() 345 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrUInt32SplatGet() 350 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrInt32SplatGet() 355 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrUInt64SplatGet() 360 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrInt64SplatGet() 365 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrFloatSplatGet() 370 DenseElementsAttr::get(unwrap(shapedType).cast<ShapedType>(), element)); in mlirDenseElementsAttrDoubleSplatGet() [all …]
|
/external/llvm-project/mlir/lib/IR/ |
D | BuiltinAttributes.cpp | 449 if (auto denseAttr = dyn_cast<DenseElementsAttr>()) in getValue() 475 if (auto intOrFpAttr = dyn_cast<DenseElementsAttr>()) in mapValues() 483 if (auto intOrFpAttr = dyn_cast<DenseElementsAttr>()) in mapValues() 674 DenseElementsAttr::AttributeElementIterator::AttributeElementIterator( in AttributeElementIterator() 675 DenseElementsAttr attr, size_t index) in AttributeElementIterator() 680 Attribute DenseElementsAttr::AttributeElementIterator::operator*() const { in operator *() 681 auto owner = getFromOpaquePointer(base).cast<DenseElementsAttr>(); in operator *() 702 DenseElementsAttr::BoolElementIterator::BoolElementIterator( in BoolElementIterator() 703 DenseElementsAttr attr, size_t dataIndex) in BoolElementIterator() 707 bool DenseElementsAttr::BoolElementIterator::operator*() const { in operator *() [all …]
|
/external/llvm-project/mlir/include/mlir/IR/ |
D | BuiltinAttributes.h | 552 class DenseElementsAttr : public ElementsAttr { 578 static DenseElementsAttr get(ShapedType type, ArrayRef<Attribute> values); 587 static DenseElementsAttr get(const ShapedType &type, ArrayRef<T> values) { 599 static DenseElementsAttr get(const ShapedType &type, T value) { 611 static DenseElementsAttr get(const ShapedType &type, ArrayRef<T> values) { 619 static DenseElementsAttr get(ShapedType type, ArrayRef<bool> values); 623 static DenseElementsAttr get(ShapedType type, ArrayRef<StringRef> values); 629 static DenseElementsAttr get(ShapedType type, ArrayRef<APInt> values); 635 static DenseElementsAttr get(ShapedType type, 642 static DenseElementsAttr get(ShapedType type, ArrayRef<APFloat> values); [all …]
|
/external/tensorflow/tensorflow/compiler/mlir/hlo/include/mlir-hlo/utils/ |
D | hlo_utils.h | 44 return DenseElementsAttr::get(ty, b->getIntegerAttr(element_ty, constant)); in getSplat() 47 return DenseElementsAttr::get(ty, b->getFloatAttr(element_ty, constant)); in getSplat() 52 return DenseElementsAttr::get(ty, in getSplat() 55 return DenseElementsAttr::get( in getSplat() 69 DenseElementsAttr GetScalarOfType(Type ty, int64_t raw_value); 84 DenseElementsAttr GetScalarLimitOfType(Type ty, ScalarLimit limit);
|
/external/tensorflow/tensorflow/compiler/mlir/lite/utils/ |
D | constant_utils.cc | 37 attr = DenseElementsAttr::get(scalar_type, floatValues); in CreateConstOpWithSingleValue() 42 attr = DenseElementsAttr::get(scalar_type, floatValues); in CreateConstOpWithSingleValue() 45 DenseElementsAttr::get<float>(scalar_type, static_cast<float>(value)); in CreateConstOpWithSingleValue() 71 attr = DenseElementsAttr::get<int8_t>(scalar_type, in CreateConstOpWithSingleValue() 75 attr = DenseElementsAttr::get<int16_t>(scalar_type, in CreateConstOpWithSingleValue() 79 attr = DenseElementsAttr::get<int32_t>(scalar_type, in CreateConstOpWithSingleValue() 83 attr = DenseElementsAttr::get<int64_t>(scalar_type, in CreateConstOpWithSingleValue()
|
/external/tensorflow/tensorflow/compiler/mlir/hlo/lib/utils/ |
D | hlo_utils.cc | 57 DenseElementsAttr GetScalarOfType(Type ty, int64_t raw_value) { in GetScalarOfType() 62 return DenseElementsAttr::get(scalar_ty, value); in GetScalarOfType() 65 return DenseElementsAttr::get(scalar_ty, value); in GetScalarOfType() 69 return DenseElementsAttr::get( in GetScalarOfType() 72 return DenseElementsAttr::get( in GetScalarOfType() 123 DenseElementsAttr GetScalarLimitOfType(Type ty, ScalarLimit limit) { in GetScalarLimitOfType() 126 return DenseElementsAttr::get(scalar_ty, in GetScalarLimitOfType() 129 return DenseElementsAttr::get( in GetScalarLimitOfType()
|
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/utils/ |
D | convert_tensor.cc | 86 return mlir::DenseElementsAttr::get( in ConvertFlatTensor() 94 return mlir::DenseElementsAttr::getFromRawBuffer( in ConvertBf16Tensor() 102 return mlir::DenseElementsAttr::getFromRawBuffer( in ConvertHalfTensor() 241 void ConvertComplexElementsAttr(const mlir::DenseElementsAttr attr, in ConvertComplexElementsAttr() 262 void ConvertElementsAttr(const mlir::DenseElementsAttr attr, in ConvertElementsAttr() 274 void ConvertHalfElementsAttr(const mlir::DenseElementsAttr attr, in ConvertHalfElementsAttr() 298 void ConvertBfloat16ElementsAttr(const mlir::DenseElementsAttr attr, in ConvertBfloat16ElementsAttr() 320 auto dense_attr = attr.dyn_cast<mlir::DenseElementsAttr>(); in ConvertToTensorProto()
|
/external/llvm-project/mlir/lib/Parser/ |
D | AttributeParser.cpp | 451 DenseElementsAttr getAttr(llvm::SMLoc loc, ShapedType type); 465 DenseElementsAttr getStringAttr(llvm::SMLoc loc, ShapedType type, Type eltTy); 468 DenseElementsAttr getHexAttr(llvm::SMLoc loc, ShapedType type); 517 DenseElementsAttr TensorLiteralParser::getAttr(llvm::SMLoc loc, in getAttr() 551 return DenseElementsAttr::get(type, complexData); in getAttr() 553 return DenseElementsAttr::get(type, intValues); in getAttr() 565 return DenseElementsAttr::get(type, complexData); in getAttr() 567 return DenseElementsAttr::get(type, floatValues); in getAttr() 667 DenseElementsAttr TensorLiteralParser::getStringAttr(llvm::SMLoc loc, in getStringAttr() 689 DenseElementsAttr TensorLiteralParser::getHexAttr(llvm::SMLoc loc, in getHexAttr() [all …]
|
/external/tensorflow/tensorflow/compiler/mlir/hlo/lib/Dialect/mhlo/IR/ |
D | hlo_ops.cc | 158 value = DenseElementsAttr::get(type.cast<TensorType>(), value); in build() 1198 DenseElementsAttr attr = operand.cast<DenseElementsAttr>(); in foldConcatenateHelper() 1205 return DenseElementsAttr::get(type, values); in foldConcatenateHelper() 1246 return DenseElementsAttr::get(type, ArrayRef<Attribute>()); in fold() 1494 auto lhsVal = operands[0].dyn_cast_or_null<DenseElementsAttr>(); in fold() 1495 auto rhsVal = operands[1].dyn_cast_or_null<DenseElementsAttr>(); in fold() 1538 auto lhsVal = operands[0].dyn_cast_or_null<DenseElementsAttr>(); in fold() 1539 auto rhsVal = operands[1].dyn_cast_or_null<DenseElementsAttr>(); in fold() 1585 auto lhsVal = operands[0].dyn_cast_or_null<DenseElementsAttr>(); in fold() 1586 auto rhsVal = operands[1].dyn_cast_or_null<DenseElementsAttr>(); in fold() [all …]
|
/external/tensorflow/tensorflow/compiler/mlir/lite/transforms/ |
D | optimize.cc | 66 bool L2NormalizeReduceAxis(Value sq_op, DenseElementsAttr axis) { in L2NormalizeReduceAxis() 154 const auto elements = val.dyn_cast<DenseElementsAttr>(); in CanFuseConvOrDepthwiseConv() 166 if (const auto elements = val.dyn_cast<DenseElementsAttr>()) { in CanFuseConvOrDepthwiseConv() 167 if (const auto filter_elements = filter.dyn_cast<DenseElementsAttr>()) { in CanFuseConvOrDepthwiseConv() 204 auto elements = a.dyn_cast<DenseElementsAttr>(); in ExpandTo4DForConvImpl() 235 DenseElementsAttr GetShape(Value output_val) { in GetShape() 243 return mlir::DenseElementsAttr::get( in GetShape() 314 DenseElementsAttr added_value; in matchAndRewrite() 445 DenseElementsAttr cst; in matchAndRewrite() 542 DenseElementsAttr gamma_cst; in matchAndRewrite() [all …]
|
D | optimize_patterns.td | 295 CPred<"$0.isa<DenseElementsAttr>() && " 296 "$0.cast<DenseElementsAttr>().getNumElements() == 1 && " 297 "std::abs(*$0.cast<DenseElementsAttr>().getValues<float>().begin()) < " 301 "L2NormalizeReduceAxis($0, $1.cast<DenseElementsAttr>())">>; 673 "($0.isa<DenseElementsAttr>() && " 674 "$0.cast<DenseElementsAttr>().getType().cast<ShapedType>().getElementType().isF32() && " 675 "std::all_of($0.cast<DenseElementsAttr>().getValues<float>().begin(), " 676 "$0.cast<DenseElementsAttr>().getValues<float>().end(), " 689 "($0.isa<DenseElementsAttr>() && " 690 "$0.cast<DenseElementsAttr>().getType().cast<ShapedType>().getElementType().isInteger(1) && " [all …]
|
/external/llvm-project/mlir/lib/Dialect/Quant/Utils/ |
D | QuantizeUtils.cpp | 38 static DenseElementsAttr 73 DenseElementsAttr realDenseAttr = realSparseAttr.getValues(); in convertSparseElementsAttr() 77 DenseElementsAttr quantDenseAttr = in convertSparseElementsAttr()
|
/external/tensorflow/tensorflow/compiler/mlir/tensorflow/transforms/ |
D | device_index_selector.cc | 68 DenseElementsAttr attr = in runOnOperation() 69 DenseElementsAttr::get(type, b.getI32IntegerAttr(index)); in runOnOperation()
|
D | unroll_batch_matmul.cc | 71 auto constant_attr = DenseElementsAttr::get(shape_spec_type, shape); in createReshapeOp() 104 DenseElementsAttr::get<int64_t>(vector3_type, {batch_idx, 0, 0}); in sliceInput() 105 auto size_attr = DenseElementsAttr::get<int64_t>(vector3_type, slice_size); in sliceInput() 139 auto perm_attr = DenseElementsAttr::get(perm_type, llvm::makeArrayRef(perm)); in createTransposeOp()
|
D | decompose_resource_ops.cc | 29 static DenseElementsAttr GetScalarOfType(Type ty, int64_t raw_value) { in GetScalarOfType() 33 return DenseElementsAttr::get(scalar_ty, attr); in GetScalarOfType() 38 return DenseElementsAttr::get(scalar_ty, attr); in GetScalarOfType()
|
D | lower_tf.cc | 74 static DenseElementsAttr GetScalarOfType(Type ty, T raw_value) { in GetScalarOfType() 78 return DenseElementsAttr::get(scalar_ty, attr); in GetScalarOfType() 81 return DenseElementsAttr::get(scalar_ty, attr); in GetScalarOfType() 85 return DenseElementsAttr::get( in GetScalarOfType() 88 return DenseElementsAttr::get( in GetScalarOfType() 357 op.getLoc(), DenseElementsAttr::get( in matchAndRewrite() 361 op.getLoc(), DenseElementsAttr::get( in matchAndRewrite() 366 DenseElementsAttr::get( in matchAndRewrite() 414 DenseElementsAttr::get(scalar_ty, ConvertToAPFloat(0.5, element_ty))); in matchAndRewrite() 487 loc, DenseElementsAttr::get( in matchAndRewrite() [all …]
|
/external/tensorflow/tensorflow/compiler/mlir/tosa/transforms/ |
D | legalize_utils.cc | 182 auto const_attr = DenseElementsAttr::get( in getTosa1DConstTensorTable() 194 auto const_attr = DenseElementsAttr::get(const_type, val); in getTosaConstTensorSingleF32() 205 auto const_attr = DenseElementsAttr::get(const_type, val); in getTosaConstTensorSingleI32() 357 DenseElementsAttr::get(const_type, llvm::makeArrayRef<T1>(arr)); in get1DConstTensor() 371 DenseElementsAttr::get(const_type, llvm::makeArrayRef<float>(arr)); in get1DConstTensor() 394 DenseElementsAttr::get(const_type, llvm::makeArrayRef<int64_t>(arr)); in get1DConstTensorInt48() 418 auto dense_attr = input_defining_op.value().dyn_cast<DenseElementsAttr>(); in getUnquantizedBias()
|
D | convert_tfl_uint8.cc | 87 mlir::DenseElementsAttr src_dense_attr = in matchAndRewrite() 88 tfl_qconst_op.value().cast<DenseElementsAttr>(); in matchAndRewrite() 137 DenseElementsAttr::get(tmp_const_type, {static_cast<uint8_t>(0)}); in convert_graph_uint8_tensor()
|
/external/llvm-project/mlir/include/mlir/Dialect/ |
D | CommonFolders.h | 53 return DenseElementsAttr::get(lhs.getType(), elementResult); in constFoldBinaryOp() 67 return DenseElementsAttr::get(lhs.getType(), elementResults); in constFoldBinaryOp()
|
/external/llvm-project/mlir/include/mlir/Bindings/Python/ |
D | Attributes.td | 30 def : PythonAttr<"::mlir::DenseElementsAttr", "_ir.DenseElementsAttr">;
|
/external/tensorflow/tensorflow/compiler/mlir/xla/ |
D | hlo_utils.h | 30 StatusOr<mlir::DenseElementsAttr> CreateDenseElementsAttrFromLiteral( 33 Status CopyDenseElementsDataToXlaFormat(mlir::DenseElementsAttr data,
|
/external/tensorflow/tensorflow/compiler/mlir/lite/ |
D | flatbuffer_import.cc | 82 using mlir::DenseElementsAttr; 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() 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() 449 return DenseElementsAttr::get(shaped_type, ArrayRef<uint64_t>(values)); in ConvertIntBuffer() 479 return DenseElementsAttr::get( in GetSplat() [all …]
|
/external/tensorflow/tensorflow/compiler/mlir/lite/ir/ |
D | tfl_ops.cc | 152 DenseElementsAttr constant; in EqualsZero() 386 Attribute ConstFoldBinaryOpDenseDense(Type result_type, DenseElementsAttr lhs, in ConstFoldBinaryOpDenseDense() 387 DenseElementsAttr rhs, in ConstFoldBinaryOpDenseDense() 405 return DenseElementsAttr::get(type, element_result); in ConstFoldBinaryOpDenseDense() 439 return DenseElementsAttr::get(type, ArrayRef<ElementValueT>(new_values)); in ConstFoldBinaryOpDenseDense() 452 if (operand1.dyn_cast_or_null<DenseElementsAttr>() && in ConstFoldBinaryOp() 453 operand2.dyn_cast_or_null<DenseElementsAttr>()) { in ConstFoldBinaryOp() 455 result_type, operand1.cast<DenseElementsAttr>(), in ConstFoldBinaryOp() 456 operand2.cast<DenseElementsAttr>(), calculate); in ConstFoldBinaryOp() 503 if (auto dense_elements = operand.dyn_cast_or_null<DenseElementsAttr>()) { in ConstFoldUnaryOp() [all …]
|