jit

package
v1.11.0-0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2023 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JitModule

type JitModule struct {
	Pointer C.JitModule
}

A container for a torch script module in C++.

func Load

func Load(path string, device *torch.Device) (*JitModule, error)

Load the JIT module from the given path and map it onto a compute device.

func (*JitModule) CastTo

func (module *JitModule) CastTo(dtype torch.Dtype) *JitModule

Cast the model's parameters to the given data-type in-place.

func (*JitModule) CopyTo

func (module *JitModule) CopyTo(device *torch.Device) *JitModule

Copy the model's parameters to the given compute accelerator in-place.

func (*JitModule) Eval

func (module *JitModule) Eval() *JitModule

Set the module to evaluation (e.g., inference) mode.

func (*JitModule) Forward

func (module *JitModule) Forward(inputs []*torch.IValue) (output *torch.IValue)

Forward pass IValues through the module and return the resulting IValue.

func (*JitModule) IsTraining

func (module *JitModule) IsTraining() bool

Return true if training features are enabled for the module, false otherwise.

func (*JitModule) Save

func (module *JitModule) Save(path string) error

Save the module to the given path.

func (*JitModule) String

func (module *JitModule) String() string

Convert the module to a human-readable string representation.

func (*JitModule) To

func (module *JitModule) To(device *torch.Device, dtype torch.Dtype) *JitModule

Cast the model's parameters to the given data-type in-place.

func (*JitModule) Train

func (module *JitModule) Train(mode bool) *JitModule

Enable/disable training features for the module.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL