Hi,
this PR aims at simplifying some of the operations done in the setup of some of the schedulers I implemented in the past weeks, relying more on the tch crate and reducing the number of casts to vectors.
Specifically:
simplify tensor interpolation: previously, since I didn't know tch supported a pytorch-equivalent of ge, called ge_tensor - ge in tch only accepts a scalar - I used a vector of tensors whose elements were eventually stacked. Now, I only work with tensors, thus porting exactly the python version.
reduce number of casts from Tensors to Vecs, mainly relying more on cat and linspace instead of working with ranges and Vec::push
stylistic change: wherever possible, I replaced slice with .i(<range>) to improve readability
Hi, this PR aims at simplifying some of the operations done in the setup of some of the schedulers I implemented in the past weeks, relying more on the
tch
crate and reducing the number of casts to vectors.Specifically:
tch
supported a pytorch-equivalent ofge
, calledge_tensor
-ge
intch
only accepts a scalar - I used a vector of tensors whose elements were eventually stacked. Now, I only work with tensors, thus porting exactly the python version.cat
andlinspace
instead of working with ranges andVec::push
slice
with.i(<range>)
to improve readability