Closed Ryang20718 closed 3 months ago
This snippet of code used to work on 2.9, but is broken on 3.13.1. Wondering if we were also exploiting a bug before?
# from mashumaro.mixins.msgpack import DataClassMessagePackMixin # (3.13.1) from mashumaro import DataClassMessagePackMixin # 2.9 import torch class MyClass(DataClassMessagePackMixin): tensor: float y = MyClass() y.tensor=torch.tensor(224.9999) print(y.to_msgpack())
I guess this works
tensor:float = field( metadata={ "serialize": lambda v: float(v) } )
This snippet of code used to work on 2.9, but is broken on 3.13.1. Wondering if we were also exploiting a bug before?