-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Use wrong placeholder type for bf16 and float16 (#2011)
See also: #2004 --------- Signed-off-by: yangxuan <[email protected]>
- Loading branch information
1 parent
b9a10c9
commit 722d2b5
Showing
7 changed files
with
115 additions
and
129 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
import struct | ||
from typing import List | ||
|
||
# reference: https://docs.python.org/3/library/struct.html#struct.pack | ||
|
||
|
||
def vector_binary_to_bytes(v: bytes): | ||
return bytes(v) | ||
|
||
|
||
# reference: https://docs.python.org/3/library/struct.html#struct.pack | ||
def vector_float_to_bytes(v: List[float]): | ||
# pack len(v) number of float | ||
return struct.pack(f"{len(v)}f", *v) |
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.