How to save tensor value to bin file

I know how I could save the tensor itself by

I need to use the torch value not in pytorch but in other program. so I want to export the only “VALUE” of the tensor as bin file.

Right now, I don’t know how to do that so just print out all the tensor value and make some code to make it binary value. but I think it is not the best idea because it is not actual bin file.

Is there any way to save the VALUE of the tensor, like Neural networks’s weights, as bin file?
please help me!