- class chainer.serializers.HDF5Deserializer(group, strict=True)¶
Deserializer for HDF5 format.
This is the standard deserializer in Chainer. This deserializer can be used to read an object serialized by
group (h5py.Group) – The group that the deserialization starts from.
strict (bool) – If
True, the deserializer raises an error when an expected value is not found in the given HDF5 file. Otherwise, it ignores the value and skip deserialization.
- __call__(key, value)¶
Serializes or deserializes a value by given name.
This operator saves or loads a value by given name.
If this is a serializer, then the value is simply saved at the key. Note that some type information might be missed depending on the implementation (and the target file format).
If this is a deserializer, then the value is loaded by the key. The deserialization differently works on scalars and arrays. For scalars, the
valueargument is used just for determining the type of restored value to be converted, and the converted value is returned. For arrays, the restored elements are directly copied into the
valueargument. String values are treated like scalars.
Serializers and deserializers are required to correctly handle the
None, serializers save it in format-dependent ways, and deserializers just return the loaded value. When the saved
Nonevalue is loaded by a deserializer, it should quietly return the
Nonevalue without modifying the
Gets a child serializer.
This operator creates a _child_ serializer represented by the given key.
key (str) – Name of the child serializer.
Loads an object from this deserializer.
This is equivalent to
obj – Target object to be serialized.
- __eq__(value, /)¶
- __ne__(value, /)¶
- __lt__(value, /)¶
- __le__(value, /)¶
- __gt__(value, /)¶
- __ge__(value, /)¶