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