Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support forward with multiple arguments #93

Open
joaolcguerreiro opened this issue May 9, 2023 · 2 comments
Open

Support forward with multiple arguments #93

joaolcguerreiro opened this issue May 9, 2023 · 2 comments

Comments

@joaolcguerreiro
Copy link

joaolcguerreiro commented May 9, 2023

Imagine I have a module like this:

class Model(nn.Module):
    def __init__(self, generator, discriminator):
        super(Model, self).__init__()

        # Define Generator
        self.generator = generator

        # Define Discriminator
        self.discriminator = discriminator

    def forward(self, lr, hr):
        gen = self.generator(lr)

        return gen, self.discriminator(gen), self.discriminator(hr)

If I want to call draw_graph(model, input_size=..., depth=1) what should the input_size look like? Is it supported?

I believe the draw_graph function could handle a input_size in a list meaning the forward will receive as many arguments as element in the list passed.

@mert-kurttutan
Copy link
Owner

Yes it is supported.
input_size is either SizeItem or list(SizeItem) where SizeItem is anything that can represent the shape of a torch Tensor, e.g. tuple, torch.Size.

@mert-kurttutan
Copy link
Owner

If this does not work you, you can also show your code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants