Exemplo n.º 1
0
 def forward(
         self,
         input: Tensor) -> Generator[stash, None, Tensor]:  # type: ignore
     yield stash('skip', input)
     return input
Exemplo n.º 2
0
 def forward(self, tensor: Tensor) -> Tensor:  # type: ignore
     yield stash('identity', tensor)
     return tensor
Exemplo n.º 3
0
 def forward(self, x):
     yield stash('hello', x)
     return self.conv(x)
Exemplo n.º 4
0
 def forward(self, input):
     yield stash('foo', input)
     return input * 2
Exemplo n.º 5
0
 def forward(self, input):
     foo = yield stash('foo')
     return input + foo
Exemplo n.º 6
0
 def forward(self, input):
     yield stash('bar', input)
     return input
Exemplo n.º 7
0
 def forward(self, input):
     yield stash('skip', input)
     return input
Exemplo n.º 8
0
 def forward(self, input):
     yield stash('none', None)
     return input
Exemplo n.º 9
0
 def forward(self, input):
     yield stash('1to3', input)
     output = self.conv(input)
     return output
Exemplo n.º 10
0
 def forward(self, tensor):
     yield stash('identity', tensor)
     return tensor
Exemplo n.º 11
0
 def forward(self, input: torch.Tensor):
     yield stash("skip", input)
     return input  # noqa  using yield together with return