lib/torch/nn/leaky_relu.rb in torch-rb-0.3.5 vs lib/torch/nn/leaky_relu.rb in torch-rb-0.3.6

- old
+ new

@@ -1,15 +1,15 @@ module Torch module NN class LeakyReLU < Module - def initialize(negative_slope: 1e-2) #, inplace: false) + def initialize(negative_slope: 1e-2, inplace: false) super() @negative_slope = negative_slope - # @inplace = inplace + @inplace = inplace end def forward(input) - F.leaky_relu(input, @negative_slope) #, inplace: @inplace) + F.leaky_relu(input, @negative_slope, inplace: @inplace) end def extra_inspect inplace_str = @inplace ? ", inplace: true" : "" format("negative_slope: %s%s", @negative_slope, inplace_str)