File size: 1,307 Bytes
ccc8053 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
--- /usr/local/lib/python3.12/dist-packages/cosmos_predict2/tokenizers/tokenizer.py
+++ /usr/local/lib/python3.12/dist-packages/cosmos_predict2/tokenizers/tokenizer.py
@@ -705,7 +705,6 @@
def count_param(self):
return sum(p.numel() for p in self.model.parameters())
- @torch.no_grad()
def encode(self, videos):
"""
videos: A list of videos each with shape [C, T, H, W].
@@ -718,7 +717,6 @@
latent = latent.to(in_dtype)
return latent
- @torch.no_grad()
def decode(self, zs):
in_dtype = zs.dtype
with self.context:
@@ -926,7 +924,6 @@
)
return num_chunks
- @torch.no_grad()
def encode(self, state: torch.Tensor) -> torch.Tensor:
if not self.squeeze_for_image:
assert state.shape[2] == 1, f"Expect the number of frames {state.shape[2]} to be 1"
@@ -945,7 +942,6 @@
latent = latent.to(in_dtype)
return latent
- @torch.no_grad()
def decode(self, state: torch.Tensor) -> torch.Tensor:
assert state.shape[2] == 1, f"Expect the number of frames {state.shape[2]} to be 1"
in_dtype = state.dtype
|