-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue with seq len < world size in tree attn decoding after new u…
…pdate, also start using tensor typing
- Loading branch information
1 parent
f3ed323
commit d91a37f
Showing
4 changed files
with
45 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from torch import Tensor | ||
|
||
from jaxtyping import ( | ||
Float, | ||
Int, | ||
Bool | ||
) | ||
|
||
# jaxtyping is a misnomer, works for pytorch | ||
|
||
class TorchTyping: | ||
def __init__(self, abstract_dtype): | ||
self.abstract_dtype = abstract_dtype | ||
|
||
def __getitem__(self, shapes: str): | ||
return self.abstract_dtype[Tensor, shapes] | ||
|
||
Float = TorchTyping(Float) | ||
Int = TorchTyping(Int) | ||
Bool = TorchTyping(Bool) | ||
|
||
__all__ = [ | ||
Float, | ||
Int, | ||
Bool | ||
] |
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