Skip to content

Commit 2d52aa7

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 7ec2e18 commit 2d52aa7

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];
@@ -2527,7 +2527,7 @@ partial interface MLGraphBuilder {
25272527
</div>
25282528

25292529
<div class="note">
2530-
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.
2530+
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.
25312531
</div>
25322532

25332533
<details open algorithm>
@@ -3388,7 +3388,7 @@ partial interface MLGraphBuilder {
33883388
<div class="note">
33893389
<details open>
33903390
<summary>
3391-
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.
3391+
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 {{MLGraphBuilder/sigmoid()}} and {{MLGraphBuilder/tanh()}} respectively.
33923392
</summary>
33933393
<pre highlight="js">
33943394
const one = builder.constant(1);
@@ -4397,7 +4397,7 @@ partial interface MLGraphBuilder {
43974397
<div class="note">
43984398
<details open>
43994399
<summary>
4400-
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.
4400+
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 {{MLGraphBuilder/sigmoid()}} and {{MLGraphBuilder/tanh()}} respectively.
44014401
</summary>
44024402
<pre highlight="js">
44034403
const zero = builder.constant(0);
@@ -5325,7 +5325,7 @@ partial interface MLGraphBuilder {
53255325
<div class="note">
53265326
<details open>
53275327
<summary>
5328-
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:
5328+
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:
53295329
</summary>
53305330
<pre highlight="js">
53315331
// Returns a tensor with all specified dimensions of input of size 1 removed.

0 commit comments

Comments
 (0)