File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
include/mlir/Dialect/Tosa/Transforms
lib/Dialect/Tosa/Transforms Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 20
20
namespace mlir {
21
21
namespace tosa {
22
22
23
- // Transform a tensor with the given transformation function.
23
+ // / Transform a tensor with the given transformation function.
24
24
DenseElementsAttr applyElementWise (
25
25
const DenseElementsAttr &toTransform,
26
26
const std::function<llvm::APFloat(const llvm::APFloat &, Type)> &toApply);
27
27
28
- // / Function that checks if arg is a dense TOSA constant float tensor
28
+ // / Function that checks if \p toCheck is a dense TOSA constant float tensor.
29
29
LogicalResult notifyIfNotConstantFloatTosaTensor (TypedValue<TensorType> toCheck,
30
30
TosaOp location,
31
31
PatternRewriter &);
32
32
33
- // / Function that checks if arg is a dense TOSA constant tensor
33
+ // / Function that checks if \p toCheck is a dense TOSA constant tensor.
34
34
LogicalResult notifyIfNoTosaDenseConstantTensor (TypedValue<TensorType> toCheck,
35
35
TosaOp location,
36
36
PatternRewriter &);
37
37
38
- // / Function that checks if the contained type is float
38
+ // / Function that checks if the type contained in \p toCheck is float.
39
39
LogicalResult notifyIfNotFloat (TypedValue<TensorType> toCheck, TosaOp location,
40
40
PatternRewriter &);
41
41
42
- // / Function to compute the reciprocal
42
+ // / Function to compute the reciprocal.
43
43
APFloat computeReciprocal (const APFloat &, Type);
44
44
45
45
} // namespace tosa
Original file line number Diff line number Diff line change @@ -34,11 +34,11 @@ DenseElementsAttr mlir::tosa::applyElementWise(
34
34
// all of them to avoid dynamic resizing
35
35
transformedValues.reserve (toTransform.getNumElements ());
36
36
for (auto val : toTransform.getValues <llvm::APFloat>()) {
37
- auto recipVal = toApply (val, toTransform.getElementType ());
38
- transformedValues.push_back (recipVal );
37
+ auto transformedVal = toApply (val, toTransform.getElementType ());
38
+ transformedValues.push_back (transformedVal );
39
39
}
40
40
41
- // Replace the current tensor with one containing the computed reciprocals
41
+ // Replace the current tensor with one containing the computed values
42
42
auto newTensor =
43
43
DenseElementsAttr::get (toTransform.getType (), transformedValues);
44
44
return newTensor;
You can’t perform that action at this time.
0 commit comments