mxnet.ndarray.save¶
-
mxnet.ndarray.
save
(fname, data)[source]¶ Saves a list of arrays or a dict of str->array to file.
Examples of filenames:
/path/to/file
s3://my-bucket/path/to/file
(if compiled with AWS S3 supports)hdfs://path/to/file
(if compiled with HDFS supports)
- Parameters
fname (str) – The filename.
data (NDArray, RowSparseNDArray or CSRNDArray, or list of NDArray, RowSparseNDArray or CSRNDArray, or dict of str to NDArray, RowSparseNDArray or CSRNDArray) – The data to save.
Examples
>>> x = mx.nd.zeros((2,3)) >>> y = mx.nd.ones((1,4)) >>> mx.nd.save('my_list', [x,y]) >>> mx.nd.save('my_dict', {'x':x, 'y':y}) >>> mx.nd.load('my_list') [<NDArray 2x3 @cpu(0)>, <NDArray 1x4 @cpu(0)>] >>> mx.nd.load('my_dict') {'y': <NDArray 1x4 @cpu(0)>, 'x': <NDArray 2x3 @cpu(0)>}