aboutsummaryrefslogtreecommitdiff
path: root/layer/affine.lua
blob: d5c50fcda8bbb60e7e10290a31f38ab95383e653 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
local LinearTransParam = nerv.class('nerv.LinearTransParam', 'nerv.Param')
local BiasParam = nerv.class('nerv.BiasParam', 'nerv.LinearTransParam')
local AffineLayer = nerv.class('nerv.AffineLayer', 'nerv.Layer')

function LinearTransParam:read(pcdata)
    self.trans = nerv.CuMatrixFloat.new_from_host(nerv.MMatrixFloat.load(pcdata))
end

function LinearTransParam:write(pfhandle)
    self.trans:new_to_host():save(pfhandle)
end