Save torchsummary

I know how to print out the model by


,So I want to know is there any way to save the text into a txt file that I don’t know how to save it? Thank you

Assuming you are using this method from torchsummary you could call:

result, params_info = summary_string(
        model, input_size, batch_size, device, dtypes)

and save the result into a file instead of printing it out.

Thank you very much!