-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add sharded tensor support to read_object when obj_out=None (#167)
Summary: Pull Request resolved: #167 # Context It is currently not possible to read a sharded tensor directly from snapshot without constructing a sharded tensor manually and passing via `obj_out` in `read_object`. # This Diff Adds `get_tensor_shape` method to `ShardedTensorEntry`, which calculates the sharded tensor's size (the largest offsets + sizes tuple). `read_object` calls this and sets `obj_out` to a cpu, regular tensor of that size. Reviewed By: galrotem, RdoubleA, yifuwang Differential Revision: D52258262 fbshipit-source-id: 01231e4132af1b0459c16e6bb8523c62d6217858
- Loading branch information
1 parent
1f42a31
commit 0e60109
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters