blob: 1909bf4d1041cecc1ce89d645c7aa8a925e3ec0c [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, 'gradInput')