@@ -36,22 +36,23 @@ DenseElementsAttr applyElementWise(
36
36
// / tensors. If the input tensors do not match \p targetType, broadcasting is
37
37
// / applied.
38
38
DenseElementsAttr applyElementWise (
39
- const DenseElementsAttr &, const DenseElementsAttr &, TensorType targetType,
39
+ const DenseElementsAttr &first, const DenseElementsAttr &second,
40
+ TensorType targetType,
40
41
const std::function<APFloat(const APFloat &, const APFloat &)> &toApply);
41
42
42
43
// / Function that checks if \p toCheck is a dense TOSA constant float tensor.
43
44
LogicalResult notifyIfNotConstantFloatTosaTensor (TypedValue<TensorType> toCheck,
44
45
TosaOp location,
45
- PatternRewriter &);
46
+ PatternRewriter &rewriter );
46
47
47
48
// / Function that checks if \p toCheck is a dense TOSA constant tensor.
48
49
LogicalResult notifyIfNoTosaDenseConstantTensor (TypedValue<TensorType> toCheck,
49
50
TosaOp location,
50
- PatternRewriter &);
51
+ PatternRewriter &rewriter );
51
52
52
53
// / Function that checks if the type contained in \p toCheck is float.
53
54
LogicalResult notifyIfNotFloat (TypedValue<TensorType> toCheck, TosaOp location,
54
- PatternRewriter &);
55
+ PatternRewriter &rewriter );
55
56
56
57
// / Compute the offset in \p shape which corresponds to the given \p index.
57
58
OffsetType indexToOffset (DimensionType shape, DimensionType index);
@@ -60,18 +61,20 @@ OffsetType indexToOffset(DimensionType shape, DimensionType index);
60
61
SmallVector<int64_t > offsetToIndex (DimensionType shape, OffsetType offset);
61
62
62
63
// / Given an \p index into \p desiredShape, compute the corresponding index into
63
- // / \p toBeBroadcasted.
64
+ // / \p toBeBroadcastedShape.
65
+ // / \returns broadcasted index into \p toBeBroadcastedShape.
64
66
SmallVector<int64_t > getBroadcastedIndex (DimensionType desiredShape,
65
- DimensionType toBeBroadcasted ,
67
+ DimensionType toBeBroadcastedShape ,
66
68
DimensionType index);
67
69
// / Given an \p offset into \p desiredShape, compute the corresponding offset
68
- // / into \p toBeBroadcasted.
70
+ // / into \p toBeBroadcastedShape.
71
+ // / \returns broadcasted offset into \p toBeBroadcastedShape.
69
72
OffsetType getBroadcastedOffset (DimensionType desiredShape,
70
- DimensionType toBeBroadcasted ,
73
+ DimensionType toBeBroadcastedShape ,
71
74
OffsetType offset);
72
75
73
76
// / Function to compute the reciprocal.
74
- APFloat computeReciprocal (const APFloat &, Type);
77
+ APFloat computeReciprocal (const APFloat &floatVal , Type floatTy );
75
78
76
79
} // namespace tosa
77
80
} // namespace mlir
0 commit comments