Tensor's equivalent method for Numpy's fromstring method?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Tensor's equivalent method for Numpy's fromstring method?

Sravan Kumar Reddy Javaji
Hello Everyone,

I have an object which was serialized to string using numpy. Normally to deserialize the object we use numpy's "fromstring" method in python. 

Is there anyway that we can use these serialized numpy objects in Lua. I mean what is the equivalent method for numpy's "fromstring" method in Tensor. 

I referred the below link and found that there is no specific equivalent for "fromstring" method.


Does it mean we cannot implement it or is it difficult to implement.

Please let me know your thoughts on this. Thanks for your time and help.

-
Regards,
Sravan
Reply | Threaded
Open this post in threaded view
|

Re: Tensor's equivalent method for Numpy's fromstring method?

Valerio
Hi,
in Lua you can load chunks of data from strings using:

The problem in your case will be the format of your serialised data, which you you need to transform from a Python-friendly to in a Lua-friendly format, maybe using some intermediary format.

best,
valerio


 

On Mon, Feb 2, 2015 at 10:47 PM, Sravan Kumar Reddy Javaji <[hidden email]> wrote:
Hello Everyone,

I have an object which was serialized to string using numpy. Normally to deserialize the object we use numpy's "fromstring" method in python. 

Is there anyway that we can use these serialized numpy objects in Lua. I mean what is the equivalent method for numpy's "fromstring" method in Tensor. 

I referred the below link and found that there is no specific equivalent for "fromstring" method.


Does it mean we cannot implement it or is it difficult to implement.

Please let me know your thoughts on this. Thanks for your time and help.

-
Regards,
Sravan

Reply | Threaded
Open this post in threaded view
|

Re: Tensor's equivalent method for Numpy's fromstring method?

Moodstocks
In reply to this post by Sravan Kumar Reddy Javaji

Le 2 févr. 2015 à 22:47, Sravan Kumar Reddy Javaji <[hidden email]> a écrit :

what is the equivalent method for numpy's "fromstring" method in Tensor

In addition to Valerio answer, and to answer specifically to the question above, the equivalent is torch.deserialize[1].

Cédric