jit_serialize: Serialize a Script Module

View source: R/trace.R

jit_serializeR Documentation

Serialize a Script Module

Description

Serializes a script module and returns it as a raw vector. You can read the object again using jit_unserialize.

Usage

jit_serialize(obj)

Arguments

obj

(script_module)
Model to be serialized.

Value

raw()

Examples

if (torch_is_installed()) {
model <- jit_trace(nn_linear(1, 1), torch_randn(1))
serialized <- jit_serialize(model)
}

torch documentation built on Aug. 21, 2025, 5:50 p.m.