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

[test] fix func signature #10271

Merged
merged 1 commit into from Feb 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/test_trainer.py
Expand Up @@ -146,7 +146,7 @@ def __init__(self, a=0, b=0, double_output=False):
self.double_output = double_output
self.config = None

def forward(self, input_x=None, labels=None, **kwargs):
def forward(self, input_x, labels=None, **kwargs):
y = input_x * self.a + self.b
if labels is None:
return (y, y) if self.double_output else (y,)
Expand All @@ -160,7 +160,7 @@ def __init__(self, a=0, b=0):
self.b = torch.nn.Parameter(torch.tensor(b).float())
self.config = None

def forward(self, input_x=None, labels=None, **kwargs):
def forward(self, input_x, labels=None, **kwargs):
y = input_x * self.a + self.b
result = {"output": y}
if labels is not None:
Expand All @@ -177,7 +177,7 @@ def __init__(self, config):
self.b = torch.nn.Parameter(torch.tensor(config.b).float())
self.double_output = config.double_output

def forward(self, input_x=None, labels=None, **kwargs):
def forward(self, input_x, labels=None, **kwargs):
y = input_x * self.a + self.b
if labels is None:
return (y, y) if self.double_output else (y,)
Expand Down