Skip to content

Conversation

@fchange
Copy link

@fchange fchange commented Nov 19, 2025

Replace deprecated device_type parameter usage with positional argument in amp.autocast calls to fix FutureWarning:

  • compressai/models/video/google.py:362
  • compressai/utils/video/eval_model/main.py:373

Changed from:
amp.autocast(device_type=device.type, enabled=...) To:
amp.autocast(device.type, enabled=...)

This uses the modern torch.amp.autocast API and improves compatibility with various device types including potential future CANN/NPU support.

Replace deprecated device_type parameter usage with positional argument
in amp.autocast calls to fix FutureWarning:
- compressai/models/video/google.py:362
- compressai/utils/video/eval_model/__main__.py:373

Changed from:
  amp.autocast(device_type=device.type, enabled=...)
To:
  amp.autocast(device.type, enabled=...)

This uses the modern torch.amp.autocast API and improves compatibility
with various device types including potential future CANN/NPU support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants