GS::Autograd::Variable
Variable wraps a Tensor and tracks gradients
Constructors
Create from existing data
ones(*dims : Int32, requires_grad : Bool = false, device : Tensor::Device = Tensor::Device::GPU) : Variable
Sourcerand(*dims : Int32, requires_grad : Bool = false, device : Tensor::Device = Tensor::Device::GPU) : Variable
SourceInstance methods
data
Sourcegrad
Sourcegrad=(grad : Tensor | Nil)
Sourcegrad_fn
Sourcegrad_fn=(grad_fn : GradFn | Nil)
SourceAppends a String representation of this object which includes its class name, its object address and the values of all instance variables.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
is_leaf?
Sourcendim
Sourcenumel
Sourcerequires_grad?
Source