Lunderberg commented on code in PR #14379:
URL: https://github.com/apache/tvm/pull/14379#discussion_r1146704620
##########
tests/python/unittest/test_tir_analysis_estimate_tir_flops.py:
##########
@@ -77,5 +77,39 @@ def test_flops_with_if():
assert flops == 16
[email protected]_func
+def flops_with_forloop_as_expression(A: T.Buffer(1)):
+ for i in T.serial(0, 16):
+ for k in T.serial(0, i):
+ A[0] = A[0] + 1
+
+
[email protected]_func
+def flops_override(a: T.Buffer(16, "float32"), b: T.Buffer(16, "float32")):
Review Comment:
Could we reduce this to a minimal PrimFunc as well? That way, it makes it
clear to the reader that the test is validating the behavior of the attribute,
and that the if/else/floormod aren't required for the test.
```python
@T.prim_func
def func(A: T.Buffer(1)):
T.func_attr("estimated_flops": 32)
for i in T.serial(0, 16):
A[0] = A[0] + 1
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]