Ported tensor serialization to using thunder::serializer