Hi,
Thanks for you answer!
it seems that data_ptr is returning an address, i.e an integer:
ipdb> self.rec_net.weight_hh_l0.data.cpu()
tensor([[ 5.4779e-02,  4.0552e-01,  2.6550e-03,  …, -5.7739e-02,
8.5938e-02, -1.3538e-01],
    ...,
    [-1.4709e-01, -3.9398e-02,  6.1707e-02,  ..., -3.1787e-01,
      2.7271e-01,  2.5806e-01],
    [ 1.4595e-02,  2.8725e-03,  2.7222e-01,  ...,  1.6602e-01,
     -7.5928e-02, -2.1057e-01]], dtype=torch.float16)

ipdb> self.rec_net.weight_hh_l0.data.cpu().data_ptr()
140297234031872
ipdb> self.rec_net.weight_hh_l0.data.cpu().data_ptr().to_bytes(length=16,byteorder=sys.byteorder)
*** AttributeError: ‘int’ object has no attribute ‘to_bytes’
Did it work for you?
Thanks,
Guy