MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / _save_binary_var

Function _save_binary_var

python/paddle/framework/io.py:776–787  ·  view source on GitHub ↗
(obj, path)

Source from the content-addressed store, hash-verified

774
775
776def _save_binary_var(obj, path):
777 if isinstance(obj, core.DenseTensor):
778 _save_dense_tensor(obj, path)
779 elif isinstance(obj, core.SelectedRows):
780 _save_selected_rows(obj, path)
781 elif isinstance(obj, core.eager.Tensor):
782 _save_dense_tensor(obj.value().get_tensor(), path)
783 else:
784 # Since the concept of 'Tensor' is only exposed to users, the error message can only contain tensor instead of 'DenseTensor' or 'SelectedRows'
785 raise NotImplementedError(
786 f"When use_binary_format = True, `paddle.save` expected Tensor, but received {type(obj)}."
787 )
788
789
790def save(

Callers 1

saveFunction · 0.85

Calls 6

_save_dense_tensorFunction · 0.85
_save_selected_rowsFunction · 0.85
NotImplementedErrorClass · 0.85
typeFunction · 0.50
get_tensorMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected