Skip to content

Commit

Permalink
Fix a few missing <details open> tags for the relevant dev notes to s…
Browse files Browse the repository at this point in the history
…tay consistent with the new style convention. (#445)
  • Loading branch information
wchao1115 authored Aug 9, 2023
1 parent 157e365 commit a799197
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,10 @@ partial interface MLGraphBuilder {
</details>

<div class="note">
<details open>
<summary>
The behavior of this operation when the input tensor is 4-D of the *"nchw"* layout and the activation is of operator type *relu* can be generically emulated from the usage of other operations as follow. However, user agents typically have a more efficient implementation for it, therefore its usage is encouraged from the performance standpoint.
</summary>
<pre highlight="js">
const shape = [1,null,1,1];
return builder.relu(
Expand All @@ -1829,7 +1832,7 @@ partial interface MLGraphBuilder {
)),
builder.reshape(options.bias, shape)));
</pre>
</div>
</details>
</div>

### The clamp() method ### {#api-mlgraphbuilder-clamp}
Expand Down Expand Up @@ -2573,10 +2576,13 @@ partial interface MLGraphBuilder {
</script>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.add(
builder.max(builder.constant(0), x),
Expand All @@ -2586,6 +2592,7 @@ partial interface MLGraphBuilder {
builder.exp(builder.min(builder.constant(0), x)),
builder.constant(1))));
</pre>
</details>
</div>

<details open>
Expand Down Expand Up @@ -3148,10 +3155,13 @@ partial interface MLGraphBuilder {
</script>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.max(
builder.min(
Expand All @@ -3161,6 +3171,7 @@ partial interface MLGraphBuilder {
builder.constant(1)),
builder.constant(0));
</pre>
</details>
</div>

{{MLHardSigmoidOptions}} has the following members:
Expand Down Expand Up @@ -3442,14 +3453,18 @@ partial interface MLGraphBuilder {
</script>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.add(builder.max(builder.constant(0), x),
builder.mul(builder.constant(options.alpha), builder.min(builder.constant(0), x)));
</pre>
</details>
</div>

{{MLLeakyReluOptions}} has the following members:
Expand Down Expand Up @@ -3543,15 +3558,19 @@ partial interface MLGraphBuilder {
</script>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.add(
builder.mul(x, builder.constant(options.alpha)),
builder.constant(options.beta));
</pre>
</details>
</div>

{{MLLinearOptions}} has the following members:
Expand Down Expand Up @@ -4485,14 +4504,18 @@ partial interface MLGraphBuilder {
</details>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.add(builder.max(builder.constant(0), x),
builder.mul(slope, builder.min(builder.constant(0), x)));
</pre>
</details>
</div>

### Reduction operations ### {#api-mlgraphbuilder-reduce}
Expand Down Expand Up @@ -4630,13 +4653,17 @@ partial interface MLGraphBuilder {
</script>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.max(builder.constant(0), x);
</pre>
</details>
</div>

#### The {{MLGraphBuilder/relu(input)}} method #### {#api-mlgraphbuilder-relu-input}
Expand Down Expand Up @@ -4862,17 +4889,21 @@ partial interface MLGraphBuilder {
</script>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.div(
builder.constant(1),
builder.add(
builder.exp(builder.neg(x)),
builder.constant(1)));
</pre>
</details>
</div>

#### The {{MLGraphBuilder/sigmoid(input)}} method #### {#api-mlgraphbuilder-sigmoid-input}
Expand Down Expand Up @@ -5055,10 +5086,13 @@ partial interface MLGraphBuilder {
</script>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.div(
builder.log(
Expand All @@ -5067,6 +5101,7 @@ partial interface MLGraphBuilder {
builder.constant(1))),
builder.constant(options.steepness));
</pre>
</details>
</div>

{{MLSoftplusOptions}} has the following members:
Expand Down Expand Up @@ -5152,13 +5187,17 @@ partial interface MLGraphBuilder {
</script>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.div(x, builder.add(builder.constant(1), builder.abs(x)));
</pre>
</details>
</div>

#### The {{MLGraphBuilder/softsign(input)}} method #### {#api-mlgraphbuilder-softsign-input}
Expand Down Expand Up @@ -5350,15 +5389,19 @@ partial interface MLGraphBuilder {
</script>

<div class="note">
<details open>
<summary>
The behavior of this operation can be generically emulated from the usage of
other operations as follow. However, user agents typically have a more
efficient implementation for it, therefore its usage is encouraged from the
performance standpoint.
</summary>
<pre highlight="js">
return builder.div(
builder.sub(builder.exp(builder.mul(builder.constant(2), x)), builder.constant(1)),
builder.add(builder.exp(builder.mul(builder.constant(2), x)), builder.constant(1)));
</pre>
</details>
</div>

#### The {{MLGraphBuilder/tanh(input)}} method #### {#api-mlgraphbuilder-tanh-input}
Expand Down

0 comments on commit a799197

Please sign in to comment.