Serialization
Saving and loading SameDiff graphs in FlatBuffers format
Saving a SameDiff Graph
save()
import org.nd4j.autodiff.samediff.SameDiff;
import java.io.File;
// Save with updater state (for resuming training)
sd.save(new File("model.fb"), true);
// Save without updater state (smaller file, for inference only)
sd.save(new File("model.fb"), false);asFlatGraph()
import java.nio.ByteBuffer;
ByteBuffer buffer = sd.asFlatGraph(true); // true = include updater stateasFlatPrint()
Loading a SameDiff Graph
load()
fromFlatGraph()
What Gets Saved
Component
Saved
Notes
Training Checkpoints
Interop with Model Import
File Format Details
Best Practices
Last updated
Was this helpful?