d2l-ai / d2l-en

Interactive deep learning book with multi-framework code, math, and discussions. Adopted at 500 universities from 70 countries including Stanford, MIT, Harvard, and Cambridge.
https://D2L.ai
Other
22.62k stars 4.2k forks source link

Fix deprecated use of torch.norm #2534

Closed dhzdhd closed 11 months ago

dhzdhd commented 12 months ago

Description of changes:

Update uses of deprecated torch.norm to torch.linalg.vector_norm if the ndim of the value passed is 1 or torch.linalg.matrix_norm if the ndim of the value passed is >= 2 in:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

github-actions[bot] commented 12 months ago

Job PR-2534-868076b is done. Check the results at http://preview.d2l.ai/d2l-en/PR-2534/868076b

astonzhang commented 11 months ago

Thanks. We'll keep norm for simplicity