Riepilogo del modello in pytorch

|

Come faccio a stampare il riepilogo di un modello in PyTorch come fa il metodo model.summary() in Keras:

Riepilogo modello: _____________________________________________________________________________________________________ Layer (digitare ) Output Shape Param # Connesso a =========================================================================================== ====================================================================================================================================== ======= input_1 (InputLayer) (Nessuno, 1, 15, 27) 0 ____________________________________________________________________________________________________ convolution2d_1 (Convolution2D) (Nessuno, 8, 15, 27) 872 input_1[0][0] ____________________________________________________________________________________________________ maxpooling2d_1 (MaxPooling2D) (Nessuno , 8, 7, 27) 0 convolution2d_1[0][0] _________________________________________________________________________________________________________ flatten_1 (Flatten) (Nessuno, 1512) 0 maxpooling2d_1[0][0] ____________________________________________________________________________________________ __________________________ denso_1 (denso) (nessuno, 1) 1513 appiattito_1[0][0] ================================= ====================================================================================================================================== ================== Parametri totali: 2.385 Parametri addestrabili: 2.385 Parametri non addestrabili: 0