v6d-io / v6d

vineyard (v6d): an in-memory immutable data manager. (Project under CNCF, TAG-Storage)
https://v6d.io
Apache License 2.0
829 stars 122 forks source link

Fix the modifications and memory occupation in vineyard torch module. #1860

Closed dashanji closed 5 months ago

dashanji commented 5 months ago

What do these changes do?

As titled.

Actually, I don't know if simply adding a value.copy() is a good way to solve this problem. Could you please take a look at this? @sighingnow

Related issue number

Fixes https://github.com/v6d-io/v6d/issues/1859

sighingnow commented 5 months ago

You should make a shallow copy of the state_dict, rather than copy the tensors...

dashanji commented 5 months ago

You should make a shallow copy of the state_dict, rather than copy the tensors...

Thanks for the suggestions.