Method: Chainer::Functions::Array::Reshape#forward

Defined in:
lib/chainer/functions/array/reshape.rb

#forward(inputs) ⇒ Object



15
16
17
18
19
# File 'lib/chainer/functions/array/reshape.rb', line 15

def forward(inputs)
  x = inputs.first
  new_shape = @shape.map { |s| s == -1 ? nil : s }
  [x.reshape(*new_shape)]
end