class

Torch::Module

Inherits Reference < Object

Constructors

load(filename : String, device : Device | Nil = nil) : self
Source
new(c_module : TorchSys::CModule)
Source

Instance methods

c_module
Source
call_method(name : String, values : Array(IValue)) : IValue
Source
each_named_parameter

Yields each named parameter (name, tensor). The tensors are owned by the wrapper and freed by GC as usual.

Source
eval
Source
finalize
Source
forward(tensors : Array(Tensor)) : Tensor

Convenience path for tensor-only modules: raises unless the module returns a single tensor.

Source
forward(values : Array(IValue)) : IValue

General path through IValues, for modules with non-tensor inputs/outputs.

Source
forward(*tensors : Tensor) : Tensor
Source
save(filename : String) : Nil
Source
to(device : Device, kind : Kind | Nil = nil, non_blocking : Bool = false) : self
Source
train
Source