TylerYep / torchinfo

View model summaries in PyTorch!
MIT License
2.6k stars 122 forks source link

multi-parameters forward function doesnt work #317

Open IKetchup opened 3 months ago

IKetchup commented 3 months ago

Hello, first of all thank you for your amazing work.

Describe the bug I have a model with the function forward take x and y in parameters.

...
def forward(x, y):
        pred = model(x,y)
...

What part of the code should I rewrite to take this modification into account ?

TylerYep commented 3 months ago

Try using explicit kwargs: summary(model, x=x, y=y)

Or using a tuple for input data: summary(model, input_data=(x,y)