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