Expand description
Something that can be saved to a .npz
(which is a .zip
).
All Modules in nn implement SaveToNpz, and the zips are formatted in a .npz
fashion.
Write this object into ZipWriter w
with a base filename of filename_prefix
.
Example:
let model: Linear<5, 10> = Default::default();
let mut zip = ZipWriter::new(...);
model.write("0.", &mut zip)?;
model.write("1.", &mut zip)?;
Will save a zip file with the following files in it:
0.weight.npy
0.bias.npy
1.weight.npy
1.bias.npy
Save this object into the .npz
file determined located at path
.
Example:
let model: (Linear<5, 10>, Linear<10, 5>) = Default::default();
model.save("tst.npz")?;
Calls SaveToNpz::write(self.<idx>, ...)
on each part of the tuple. See SaveToNpz.
E.g. for a two tuple (A, B) with base == ""
, this will call:
self.0.write("0.", w)
self.1.write("1.", w)
Calls SaveToNpz::write(self.<idx>, ...)
on each part of the tuple. See SaveToNpz.
E.g. for a two tuple (A, B) with base == ""
, this will call:
self.0.write("0.", w)
self.1.write("1.", w)
Calls SaveToNpz::write(self.<idx>, ...)
on each part of the tuple. See SaveToNpz.
E.g. for a two tuple (A, B) with base == ""
, this will call:
self.0.write("0.", w)
self.1.write("1.", w)
Calls SaveToNpz::write(self.<idx>, ...)
on each part of the tuple. See SaveToNpz.
E.g. for a two tuple (A, B) with base == ""
, this will call:
self.0.write("0.", w)
self.1.write("1.", w)
Calls SaveToNpz::write(self.<idx>, ...)
on each part of the tuple. See SaveToNpz.
E.g. for a two tuple (A, B) with base == ""
, this will call:
self.0.write("0.", w)
self.1.write("1.", w)