Closed Athospd closed 5 years ago
@Athospd I think it didn't work median and mode, because when you have a dim argument median will return 2 tensors: the medians for each row and the index of the median for each row.
In this case I think we will need 2 functions: 1 to calculate the median (without any additional args) and another to calculate the median with and return both tensors to R. tensor_qr_
has a reference implementation for this. Then we need to create some glue code on the R side.
@Athospd I created a reference implementation for tch_mean
here: https://github.com/dfalbel/torch/blob/4bd94ae7db65f0dbf0308e1cca892eec359f13a0/src/tensor.cpp#L1037-L1049
We need to adapt other functions that have this kind of behavior to use this.
@dfalbel I found out that the following functions has the tuple (dim, keepdim) args:
argmax argmin logsumexp median mode norm prod std sum var kthvalue max min
We have to adapt these using mean as reference, I got it right?
Exactly!
I will close this PR and merge #31 .
tch functions implemented:
Methods:
tch functions that I failed to implement:
Notes: