Closed dfalbel closed 5 years ago
We need to wrap all tensor factories, add tests and docs for all of them. Currently only tch_randn is implemented and can serve as an example.
tch_randn
Here are the relevant lines of code:
C++ wraper: https://github.com/dfalbel/torch/blob/aa6742dc39ad903e89852bef8fd372af52392a37/src/tensor.cpp#L163
R wraper: https://github.com/dfalbel/torch/blob/aa6742dc39ad903e89852bef8fd372af52392a37/R/tensor.R#L114
Tests: https://github.com/dfalbel/torch/blob/aa6742dc39ad903e89852bef8fd372af52392a37/tests/testthat/test-tensor.R#L908
[x] tch_randn: Returns a tensor filled with values drawn from a unit normal distribution,
[x] tch_arange: Returns a tensor with a sequence of integers,
tch_arange
[x] tch_empty: Returns a tensor with uninitialized values,
tch_empty
[x] tch_eye: Returns an identity matrix,
tch_eye
[x] tch_full: Returns a tensor filled with a single value,
tch_full
[x] tch_linspace: Returns a tensor with values linearly spaced in some interval,
tch_linspace
[x] tch_logspace: Returns a tensor with values logarithmically spaced in some interval,
tch_logspace
[x] tch_ones: Returns a tensor filled with all ones,
tch_ones
[x] tch_rand: Returns a tensor filled with values drawn from a uniform distribution on [0, 1).
tch_rand
[x] tch_randint: Returns a tensor with integers randomly drawn from an interval,
tch_randint
[x] tch_randperm: Returns a tensor filled with a random permutation of integers in some interval,
tch_randperm
[x] tch_zeros: Returns a tensor filled with all zeros.
tch_zeros
We need to wrap all tensor factories, add tests and docs for all of them. Currently only
tch_randn
is implemented and can serve as an example.Here are the relevant lines of code:
C++ wraper: https://github.com/dfalbel/torch/blob/aa6742dc39ad903e89852bef8fd372af52392a37/src/tensor.cpp#L163
R wraper: https://github.com/dfalbel/torch/blob/aa6742dc39ad903e89852bef8fd372af52392a37/R/tensor.R#L114
Tests: https://github.com/dfalbel/torch/blob/aa6742dc39ad903e89852bef8fd372af52392a37/tests/testthat/test-tensor.R#L908
[x]
tch_randn
: Returns a tensor filled with values drawn from a unit normal distribution,[x]
tch_arange
: Returns a tensor with a sequence of integers,[x]
tch_empty
: Returns a tensor with uninitialized values,[x]
tch_eye
: Returns an identity matrix,[x]
tch_full
: Returns a tensor filled with a single value,[x]
tch_linspace
: Returns a tensor with values linearly spaced in some interval,[x]
tch_logspace
: Returns a tensor with values logarithmically spaced in some interval,[x]
tch_ones
: Returns a tensor filled with all ones,[x]
tch_rand
: Returns a tensor filled with values drawn from a uniform distribution on [0, 1).[x]
tch_randint
: Returns a tensor with integers randomly drawn from an interval,[x]
tch_randperm
: Returns a tensor filled with a random permutation of integers in some interval,[x]
tch_zeros
: Returns a tensor filled with all zeros.