blob: 09c7e1b8e8e04beaf029f8fa63ec04339d4af0de [file] [log] [blame]
import torch
from .Module import Module
from .utils import clear
class Identity(Module):
def updateOutput(self, input):
self.output = input
return self.output
def updateGradInput(self, input, gradOutput):
self.gradInput = gradOutput
return self.gradInput
def clearState(self):
clear(self, [
'output',
'gradInput',
])
return super(Identity, self).clearState()