Torch::Module
Inherits Reference < Object
Constructors
load(filename : String, device : Device | Nil = nil) : self
Sourcenew(c_module : TorchSys::CModule)
SourceInstance methods
c_module
Sourcecall_method(name : String, values : Array(IValue)) : IValue
Sourceeach_named_parameter
Yields each named parameter (name, tensor). The tensors are owned by the wrapper and freed by GC as usual.
eval
Sourcefinalize
Sourceforward(tensors : Array(Tensor)) : Tensor
Convenience path for tensor-only modules: raises unless the module returns a single tensor.
forward(values : Array(IValue)) : IValue
General path through IValues, for modules with non-tensor inputs/outputs.
forward(*tensors : Tensor) : Tensor
Sourcesave(filename : String) : Nil
Sourcetrain
Source