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

[PYTORCH]Std op without specified dimensions support #6226

Merged
merged 1 commit into from
Aug 7, 2020
Merged

[PYTORCH]Std op without specified dimensions support #6226

merged 1 commit into from
Aug 7, 2020

Conversation

shiwenloong
Copy link
Contributor

@shiwenloong shiwenloong commented Aug 6, 2020

Std op in torchscript supports overloading (https://pytorch.org/docs/stable/jit_builtin_functions.html#builtin-functions) :

torch.std(self : Tensor,
          unbiased : bool=True) -> Tensor

torch.std(self : Tensor,
          dim : List[int],
          unbiased : bool=True,
          keepdim : bool=False) -> Tensor

The std op without specified dimensions was not supported in current pytorch frontend, so pytorch module like below can't be converted.

class StdModule(nn.Module):
    def forward(self, *args):
        return args[0].std(unbiased=False)

This PR fixes the problem.
@masahi Please help to review this PR. Thanks.

@masahi masahi merged commit c1eb315 into apache:master Aug 7, 2020
@masahi
Copy link
Member

masahi commented Aug 7, 2020

Thanks @shiwenloong

@shiwenloong shiwenloong deleted the fix_std branch August 7, 2020 10:19
wjliu1998 pushed a commit to wjliu1998/incubator-tvm that referenced this pull request Aug 13, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
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

Successfully merging this pull request may close these issues.

2 participants