
Serializes a script module and returns it as a raw vector.
You can read the object again using jit_unserialize
.
jit_serialize(obj)
(script_module
)
Model to be serialized.
if (torch_is_installed()) {
model <- jit_trace(nn_linear(1, 1), torch_randn(1))
serialized <- jit_serialize(model)
}
Run the code above in your browser using DataLab