@leimao
Yes, data(), that’s sudo code, sry.
Did you check the example I send you?
‘https://github.com/pytorch/pytorch/blob/ac8c7c4e9f45f74652df9d068066b7ef297637de/test/cpp/rpc/test_tensorpipe_serialization.cpp#L125 97’
You can cast the data() ptr to the type you need.