Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

WebGL: Fix potential compilation failure in LeakyRelu op #106

Merged
merged 2 commits into from
Mar 15, 2019

Conversation

hariharans29
Copy link
Member

No description provided.

@@ -19,7 +19,7 @@ export class WebGLLeakyRelu extends LeakyRelu implements WebGLOperator {
uniform sampler2D A;
void main() {
float v = texture2D(A, TexCoords).r;
gl_FragColor = vec4(v < 0.0 ? v * ${this.alpha} : v);
gl_FragColor = vec4(v < 0.0 ? v * float(${this.alpha}) : v);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is float() works in compile time or runtime in glsl? if it is the latter then toExponential() is a better option

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can tackle this solution across all the shaders (many shaders need the answer to that investigation)

@hariharans29 hariharans29 merged commit 988f891 into microsoft:master Mar 15, 2019
@hariharans29 hariharans29 deleted the WebGlLeakyRelu branch March 15, 2019 23:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants