dfalbel / torch

torch from R!
http://dfalbel.github.io/torch
Other
50 stars 5 forks source link

Remainder #48

Closed Athospd closed 5 years ago

Athospd commented 5 years ago

x$remainder x$remainder_

Comments:

Pytorch's docs states that fmod() and remainder() accept args that are broadcastable, but apparentely it do not.

Python

import torch as t

x = t.arange(0, 4)
x.fmod(t.ones(4, dtype = t.int64)) # works
x.fmod(t.ones(2, dtype = t.int64)) # do not work

R

library(torch)
x <- tch_arange(0, 4)
x$fmod(tch_ones(2)) # works
x$fmod(tch_ones(4))  # do not work