File size: 221 Bytes
e9fe176
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'nn'
require 'Scale'

a = nn.Scale(100)
x = torch.rand(2, 3, 4, 4):mul(200/16)
y = torch.Tensor({{2, 2, 3, 3}, {1, 1, 3, 3}})

z = a:forward({x, y})
w = a:backward({x, y}, z)

print(x)
print(y)
print(z)
print(w)