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

Confusion with conv1 accepting x and task_label in _forward_impl method of the 'ResNetGrad' class in models/vlcs.py #2

Open
ZexiChen502 opened this issue Jul 26, 2024 · 0 comments

Comments

@ZexiChen502
Copy link

I encountered an confusion in the _forward_impl method of the ResNetGrad class in models/vlcs.py, where conv1 is called with both x and task_label. Since conv1 is a standard torch.nn.Conv2d layer, it can only accept a single input tensor x. Passing two arguments (x and None) may result in an error?

class ResNetGrad(nn.Module):

def __init__(self, block, layers, num_classes=1000, zero_init_residual=False, groups=1, width_per_group=64,
             replace_stride_with_dilation=None, norm_layer=None, ratio=1, lora_layer=None, lora_rank=None, **kwargs):
    super(ResNetGrad, self).__init__()
    ......
    self.conv1 = torch.nn.Conv2d(3, self.inplanes, kernel_size=7, stride=2, padding=3, bias=False)
    ......

def _forward_impl(self, x, task_label=None, return_features=False):
   ......
    x = self.conv1(x, task_label)
   ......

Great work, looking forward to your team's reply

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

1 participant