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

- old
+ new

@@ -176,11 +176,15 @@ def hardshrink(input, lambd = 0.5) Torch.hardshrink(input, lambd) end - def leaky_relu(input, negative_slope = 0.01) - NN.leaky_relu(input, negative_slope) + def leaky_relu(input, negative_slope = 0.01, inplace: false) + if inplace + NN.leaky_relu!(input, negative_slope) + else + NN.leaky_relu(input, negative_slope) + end end def log_sigmoid(input) NN.log_sigmoid(input) end