Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.
Draft
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
13 changes: 0 additions & 13 deletions wonnx/templates/endomorphism/map.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
let boundary = one * {{ scalar_type }}(10);
let intermediate = max(-boundary, min(boundary, input_0.data[gidx]));
output_0.data[gidx] = tanh(intermediate);
{% elif op_type == "Sign" %}
{# sign(input_0.data[gidx]) should work but for some reason fails on Windows. Therefore we implement it here the slow way... #}
{% for i in range(end = 4) %}
if input_0.data[gidx][{{i}}] < {{ scalar_type }}(0) {
output_0.data[gidx][{{i}}] = {{ scalar_type }}(-1);
}
else if input_0.data[gidx][{{i}}] > {{ scalar_type }}(0) {
output_0.data[gidx][{{i}}] = {{ scalar_type }}(1);
}
else {
output_0.data[gidx][{{i}}] = {{ scalar_type }}(0);
}
{% endfor %}
{% else %}
output_0.data[gidx] = {{ op_type | lower }}(input_0.data[gidx]);

Expand Down