Lunderberg commented on PR #16827:
URL: https://github.com/apache/tvm/pull/16827#issuecomment-2031766016
> Is there a particular use case for arithmetic with PrimValues and tensors?
Primarily for cases where a dynamic computation requires use of a dynamic
shape (e.g. RMS_norm). Or simpler cases, like computing the mean.
```python
@R.function
def mean(A: R.Tensor(['m','n'], 'float32') -> R.Tensor(['m'], 'float32'):
n = T.int64()
sum = R.sum(A, axis=1, keep=False)
output = sum / n.astype('float32') # Allow expressing this step.
return output
```
--
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]