Documentation ¶
Index ¶
- type JitModule
- func (module JitModule) CastTo(dtype torch.Dtype) JitModule
- func (module JitModule) CopyTo(device torch.Device) JitModule
- func (module JitModule) Eval() JitModule
- func (module JitModule) Forward(inputs []torch.IValue) torch.IValue
- func (module JitModule) IsTraining() bool
- func (module JitModule) Save(path string) error
- func (module JitModule) String() string
- func (module JitModule) Train(mode bool) JitModule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JitModule ¶
type JitModule struct { // We use an unsafe pointer so there are no weird C types in the struct. T *unsafe.Pointer }
A container for a torch script module in C++.
func Load ¶
Load the trace from the given path on the filesystem. @param path A path to a model trace on the filesystem. @returns A tuple of: - The tensor that was loaded (nil if an error occurred,) and - An error that may have occurred (nil if the operation succeeds.)
func (JitModule) Forward ¶
func (module JitModule) Forward(inputs []torch.IValue) torch.IValue
Forward pass through the module. @param inputs A list of IValue structures to propagate. @returns An IValue representation of the output from the module.
func (JitModule) IsTraining ¶
Return true if training features are enabled for the module, false otherwise.
func (JitModule) Save ¶
Save the module to the given path. @param path A valid path on the file-system to save the module data to.