def forward_gpu(self, inputs): x = inputs[0] return cuda.elementwise( 'T x', 'T y', 'y = min(1.0, max(0.0, x * 0.2 + 0.5))', 'hard_sigmoid_fwd' )(x),