mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
Summary: Applies the black-fbsource codemod with the new build of pyfmt. paintitblack Test Plan: Probably going to have to ignore signals and just land it. **Static Docs Preview: pyre** |[Full Site](https://our.intern.facebook.com/intern/staticdocs/eph/D36324783/V4/pyre/)| |**Modified Pages**| **Static Docs Preview: classyvision** |[Full Site](https://our.intern.facebook.com/intern/staticdocs/eph/D36324783/V4/classyvision/)| |**Modified Pages**| **Static Docs Preview: antlir** |[Full Site](https://our.intern.facebook.com/intern/staticdocs/eph/D36324783/V4/antlir/)| |**Modified Pages**| Reviewed By: lisroach Differential Revision: D36324783 fbshipit-source-id: 280c09e88257e5e569ab729691165d8dedd767bc (cherry picked from commit 704f50c9e6bb4386802f440aee814a7d3c7b4c31)
23 lines
429 B
Python
23 lines
429 B
Python
# Owner(s): ["oncall: package/deploy"]
|
|
|
|
import torch
|
|
|
|
try:
|
|
from torchvision.models import resnet18
|
|
|
|
class TorchVisionTest(torch.nn.Module):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.tvmod = resnet18()
|
|
|
|
def forward(self, x):
|
|
x = a_non_torch_leaf(x, x)
|
|
return torch.relu(x + 3.0)
|
|
|
|
except ImportError:
|
|
pass
|
|
|
|
|
|
def a_non_torch_leaf(a, b):
|
|
return a + b
|