Skip to content

Commit 9405358

Browse files
committed
gpu support
1 parent 06b9d76 commit 9405358

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

compressai/entropy_models/entropy_models.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -878,10 +878,10 @@ def compress(self, y, scales, means, weights):
878878
# abs_max + 1,
879879
# )
880880
rv = self.entropy_coder._encoder.encode_with_indexes_gmm(
881-
symbols,
882-
scales,
883-
means,
884-
weights,
881+
symbols.to("cpu"),
882+
scales.to("cpu"),
883+
means.to("cpu"),
884+
weights.to("cpu"),
885885
abs_max + 1
886886
)
887887

@@ -900,9 +900,9 @@ def decompress(self, strings, abs_max, zero_bitmap, scales, means, weights):
900900
# )
901901
symbols = self.entropy_coder._decoder.decode_with_indexes_gmm(
902902
strings,
903-
scales,
904-
means,
905-
weights,
903+
scales.to("cpu"),
904+
means.to("cpu"),
905+
weights.to("cpu"),
906906
abs_max + 1
907907
)
908908

0 commit comments

Comments
 (0)