-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Siyao <[email protected]> Co-authored-by: m-barker <[email protected]> Co-authored-by: Haiwei L <[email protected]> Co-authored-by: fireblonde <[email protected]> Co-authored-by: Benteng Ma <[email protected]>
- Loading branch information
1 parent
64a7495
commit b55959e
Showing
74 changed files
with
6,492 additions
and
1,255 deletions.
There are no files selected for viewing
Submodule custom_worlds
added at
315d43
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import numpy as np | ||
|
||
|
||
def numpy2message(np_array: np.ndarray) -> list[bytes, list[int], str]: | ||
data = np_array.tobytes() | ||
shape = list(np_array.shape) | ||
dtype = str(np_array.dtype) | ||
return data, shape, dtype | ||
|
||
|
||
def message2numpy(data: bytes, shape: list[int], dtype: str) -> np.ndarray: | ||
array_shape = tuple(shape) | ||
array_dtype = np.dtype(dtype) | ||
|
||
deserialized_array = np.frombuffer(data, dtype=array_dtype) | ||
deserialized_array = deserialized_array.reshape(array_shape) | ||
|
||
return deserialized_array |
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
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
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
Oops, something went wrong.