tweaks Num.as_tensor to also accept a Tensor class as like: param; using which ...
fixes Num::Grad::Context#variable(Number...) which wasn't working; using which ...
adds unary negation operator for Num::Grad::Variable.
fixes Num::Grad::Variable method #sum and #mean to carry on the requires_grad property for new variables (which I missed in #85 .
fixed compiler warning due to parameter name mismatch between abstract base class Num::Storage::Backend and CPU/OCL implementations. I chose to use hostptr in the base class and fix the CPU implementation. (If you prefer to go the other way, i.e. use data all the way through, no worries, let me know.)
I appreciate your patience with my recent slew of small PRs. š
Caveats
This PR is a bit of a combo; it primarily adds negation to Grad::Variable and then I tacked on a couple of small tweaks. If you prefer that I split them out, no worries, let me know.
I didn't create an issue first; if you prefer that I do so, let me know, it's no bother.
@christopherzimmerman, this PR
Num.as_tensor
to also accept aTensor
class aslike:
param; using which ...Num::Grad::Context#variable(Number...)
which wasn't working; using which ...Num::Grad::Variable
.Num::Grad::Variable
method#sum
and#mean
to carry on therequires_grad
property for new variables (which I missed in #85 .Num::Storage::Backend
and CPU/OCL implementations. I chose to usehostptr
in the base class and fix the CPU implementation. (If you prefer to go the other way, i.e. usedata
all the way through, no worries, let me know.)I appreciate your patience with my recent slew of small PRs. š
Caveats
Grad::Variable
and then I tacked on a couple of small tweaks. If you prefer that I split them out, no worries, let me know.