Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 390 Bytes

ScriptModule.md

File metadata and controls

14 lines (11 loc) · 390 Bytes

Sample ScriptModule Usage

forward

The script_module may be used to load up any model in TorchScript, and perform operations on it

const torch = require("torch-js");
const modelPath = `test_model.pt`;
const model = new torch.ScriptModule(testModelPath);
const inputA = torch.rand([1, 5]);
const inputB = torch.rand([1, 5]);
const res = await model.forward(inputA, inputB);