Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions backends/vulkan/runtime/graph/ops/glsl/unary/unary_op.glslh
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,8 @@ vec4 hardsigmoid(vec4 tex) {
hardsigmoid(tex.w));
}

float leaky_relu(float x, float negative_slope) {
return x * (float(x > 0.0) + negative_slope * float(x <= 0.0));
}

vec4 leaky_relu(vec4 tex, float negative_slope) {
return vec4(
leaky_relu(tex.x, negative_slope),
leaky_relu(tex.y, negative_slope),
leaky_relu(tex.z, negative_slope),
leaky_relu(tex.w, negative_slope));
return mix(tex * negative_slope, tex, greaterThan(tex, vec4(0)));
}
#endif

Expand Down
Loading