File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
compressors/sparse_compressors Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,10 @@ def from_compressed_data(
103
103
:param bitmask: 2d bitmask of non-zero values
104
104
:return: instantiated Sparse24BitMaskTensor
105
105
"""
106
- if isinstance (shape , Tensor ):
107
- shape = shape .tolist ()
106
+ if isinstance (shape , list ):
107
+ shape = torch .tensor (shape )
108
+ if isinstance (shape , torch .Tensor ):
109
+ shape = shape .flatten ().tolist ()
108
110
return Sparse24BitMaskTensor (
109
111
shape = shape , compressed = compressed , bitmask = bitmask
110
112
)
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ def pack_bitmasks(bytemasks: torch.Tensor) -> torch.Tensor:
301
301
302
302
303
303
def unpack_bitmasks (
304
- packed_bitmasks : torch .Tensor , original_shape : torch . Size
304
+ packed_bitmasks : torch .Tensor , original_shape : List [ int ]
305
305
) -> torch .Tensor :
306
306
"""
307
307
Converts a bitmask tensor back to a bytemask tensor for use during decompression
You can’t perform that action at this time.
0 commit comments