Skip to content

Commit bc45246

Browse files
Bug fix: Link operator names to the MLGraphBuilder methods
For a "reshape" reference a malformed IDL link was present. The other references are linked as appropriately to the builder references rather than just being styled text.
1 parent c9d2dd7 commit bc45246

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

SpecCodingConventions.md

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Example:
7070
1. If |shape| is a [=circle=], draw it at |shape|'s [=circle/origin=].
7171
```
7272

73+
* When referencing an operator in text (e.g. sigmoid, tanh, etc), link the operator name to the `MLGraphBuilder` methods for creating the corresponding `MLOperand` or `MLActivation`, e.g. `{{MLGraphBuilder/sigmoid()}}`. This provides consistent styling, and provides a thorough overview of the operator, even if the method itself isn't being discussed.
74+
7375

7476
### Formatting
7577

index.bs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ partial interface MLGraphBuilder {
16371637
<div class="note">
16381638
<details open>
16391639
<summary>
1640-
The behavior of this operation when the input tensor is 4-D of the {{MLInputOperandLayout/"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.
1640+
The behavior of this operation when the input tensor is 4-D of the {{MLInputOperandLayout/"nchw"}} layout and the activation is {{MLGraphBuilder/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.
16411641
</summary>
16421642
<pre highlight="js">
16431643
const shape = [1,null,1,1];
@@ -2508,7 +2508,7 @@ partial interface MLGraphBuilder {
25082508
</div>
25092509

25102510
<div class="note">
2511-
Although operations *greaterOrEqual* and *lesserOrEqual* can each be implemented in terms of operations *not*, *lesser*, and *greater* in other words `greater-or-equal(a, b)` is `not(lesser(a, b))`, they are specifically defined to handle NaN cases and for performance reason to avoid double comparisons.
2511+
Although operations {{MLGraphBuilder/greaterOrEqual()}} and {{MLGraphBuilder/lesserOrEqual()}} can each be implemented in terms of operations {{MLGraphBuilder/not()}}, {{MLGraphBuilder/lesser()}}, and {{MLGraphBuilder/greater()}} in other words `builder.greaterOrEqual(a, b)` is `builder.not(builder.lesser(a, b))`, they are specifically defined to handle NaN cases and for performance reason to avoid double comparisons.
25122512
</div>
25132513

25142514
<details open algorithm>
@@ -3368,7 +3368,7 @@ partial interface MLGraphBuilder {
33683368
<div class="note">
33693369
<details open>
33703370
<summary>
3371-
The behavior of this operation can be generically emulated via other operations as shown below, when the weight layout is the default {{MLGruWeightLayout/"zrn"}} layout, and the activation functions of the update/reset gate and new gate are of the operator types *sigmoid* and *tanh* respectively.
3371+
The behavior of this operation can be generically emulated via other operations as shown below, when the weight layout is the default {{MLGruWeightLayout/"zrn"}} layout, and the activation functions of the update/reset gate and new gate are {{MLGraphBuilder/sigmoid()}} and {{MLGraphBuilder/tanh()}} respectively.
33723372
</summary>
33733373
<pre highlight="js">
33743374
const one = builder.constant(1);
@@ -4372,7 +4372,7 @@ partial interface MLGraphBuilder {
43724372
<div class="note">
43734373
<details open>
43744374
<summary>
4375-
The behavior of this operation can be generically emulated via other operations as shown below, when the weight layout is the default {{MLLstmWeightLayout/"iofg"}} layout, and the activation functions of the input/forget/output gate and the cell gate/the cell state's filter for the output hidden state are of the operator types *sigmoid* and *tanh* respectively.
4375+
The behavior of this operation can be generically emulated via other operations as shown below, when the weight layout is the default {{MLLstmWeightLayout/"iofg"}} layout, and the activation functions of the input/forget/output gate and the cell gate/the cell state's filter for the output hidden state are {{MLGraphBuilder/sigmoid()}} and {{MLGraphBuilder/tanh()}} respectively.
43764376
</summary>
43774377
<pre highlight="js">
43784378
const zero = builder.constant(0);
@@ -5290,7 +5290,7 @@ partial interface MLGraphBuilder {
52905290
<div class="note">
52915291
<details open>
52925292
<summary>
5293-
Many shape-related operations such as [squeeze](https://pytorch.org/docs/stable/generated/torch.squeeze.html), [unsqueeze](https://pytorch.org/docs/stable/generated/torch.unsqueeze.html), and [flatten](https://pytorch.org/docs/stable/generated/torch.flatten.html) can be generically implemented using the *reshape*}} operation as follows:
5293+
Many shape-related operations such as [squeeze](https://pytorch.org/docs/stable/generated/torch.squeeze.html), [unsqueeze](https://pytorch.org/docs/stable/generated/torch.unsqueeze.html), and [flatten](https://pytorch.org/docs/stable/generated/torch.flatten.html) can be generically implemented using the {{MLGraphBuilder/reshape()}} operation as follows:
52945294
</summary>
52955295
<pre highlight="js">
52965296
// Returns a tensor with all specified dimensions of input of size 1 removed.

0 commit comments

Comments
 (0)