CompressAI icon indicating copy to clipboard operation
CompressAI copied to clipboard

fix: update torch.amp.autocast to use modern API

Open fchange opened this issue 3 months ago • 0 comments

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.

fchange avatar Nov 19 '25 08:11 fchange