local IdentityLayer = nerv.class('nerv.IdentityLayer', 'nerv.Layer') function IdentityLayer:__init(id, global_conf, layer_conf) nerv.Layer.__init(self, id, global_conf, layer_conf) self:check_dim_len(1, 1) if self.dim_in[1] ~= self.dim_out[1] then nerv.error('mismatching dimensions of input and output') end end function IdentityLayer:init() end function IdentityLayer:batch_resize() end function IdentityLayer:propagate(input, output) output[1]:copy_from(input[1]) end function IdentityLayer:back_propagate(bp_err, next_bp_err) next_bp_err[1]:copy_from(bp_err[1]) end function IdentityLayer:update() end function IdentityLayer:get_params() return nerv.ParamRepo({}, self.loc_type) end function IdentityLayer:bind_params() -- do nothing end