PrintTable.lua 391 B

12345678910111213141516
  1. local PrintTable, parent = torch.class('w2nn.PrintTable','nn.Module')
  2. function PrintTable:__init(id)
  3. parent.__init(self)
  4. self.id = id
  5. end
  6. function PrintTable:updateOutput(input)
  7. print("----", self.id)
  8. print(input)
  9. self.output = input
  10. return self.output
  11. end
  12. function PrintTable:updateGradInput(input, gradOutput)
  13. self.gradInput = gradOutput
  14. return self.gradInput
  15. end