Skip to content

Commit

Permalink
fix typo (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-tuli authored Jan 20, 2025
1 parent 0ba31bf commit 9a0afd6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ def from_compressed_data(
:param bitmask: 2d bitmask of non-zero values
:return: instantiated Sparse24BitMaskTensor
"""
if isinstance(shape, Tensor):
shape = shape.tolist()
if isinstance(shape, list):
shape = torch.tensor(shape)
if isinstance(shape, torch.Tensor):
shape = shape.flatten().tolist()
return Sparse24BitMaskTensor(
shape=shape, compressed=compressed, bitmask=bitmask
)
Expand Down
2 changes: 1 addition & 1 deletion src/compressed_tensors/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def pack_bitmasks(bytemasks: torch.Tensor) -> torch.Tensor:


def unpack_bitmasks(
packed_bitmasks: torch.Tensor, original_shape: torch.Size
packed_bitmasks: torch.Tensor, original_shape: List[int]
) -> torch.Tensor:
"""
Converts a bitmask tensor back to a bytemask tensor for use during decompression
Expand Down

0 comments on commit 9a0afd6

Please sign in to comment.