Skip to content

Commit

Permalink
doc: graph: add document for GenIndex and GreaterEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
ElaineBao committed Jan 7, 2025
1 parent 1d858db commit d9e07d7
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
39 changes: 39 additions & 0 deletions doc/graph/operations/GenIndex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
GenIndex{#dev_guide_op_genindex}
================================

## General

The GenIndex operation creates an index tensor along a specified axis of
an input tensor. The resulting index tensor has the same shape as the
input tensor, with each element representing the index along the
specified axis.

## Operation attributes

| Attribute Name | Description | Value Type | Supported Values | Required or Optional |
|:-------------------------------------------------------------|:-----------------------------------------------------------|:-----------|:-------------------------|:---------------------|
| [axis] (@ref dnnl::graph::op::attr::axis) | Specifies the dimension along which index values are generated. | s64 | An s64 value in the range of [-r, r-1] where r = rank(src) | Required |

## Execution Arguments

### Input

| Index | Argument Name | Required or Optional |
|:------|:--------------|:---------------------|
| 0 | `src` | Required |

### Output

| Index | Argument Name | Required or Optional |
|:------| --------------|:---------------------|
| 0 | `dst` | Required |

## Supported Data Types

The GenIndex operation supports the following data type combinations.

| Src | Dst |
|:-------|:-------|
| f32 | s32 |
| bf16 | s32 |
| f16 | s32 |
49 changes: 49 additions & 0 deletions doc/graph/operations/GreaterEqual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
GreaterEqual{#dev_guide_op_greaterequal}
========================================

## General

The GreaterEqual operation performs an element-wise greater-than-or-equal
comparison between two given tensors. This operation applies
the multi-directional broadcast rules to ensure compatibility between
the tensors of different shapes.

\f[ dst = \begin{cases} true & \text{if}\ src_0 \ge src_1 \\
false & \text{if}\ src_0 < src_1 \end{cases} \f]

## Operation Attributes

| Attribute Name | Description | Value Type | Supported Values | Required or Optional |
|:-------------------------------------------------------------|:-----------------------------------------------------------|:-----------|:-------------------------|:---------------------|
| [auto_broadcast](@ref dnnl::graph::op::attr::auto_broadcast) | Specifies rules used for auto-broadcasting of src tensors. | string | `none`,`numpy` (default) | Optional |

## Execution Arguments

### Input

| Index | Argument Name | Required or Optional |
|:------|:--------------|:---------------------|
| 0 | `src_0` | Required |
| 1 | `src_1` | Required |

@note Both src shapes should match and no auto-broadcasting is allowed if
the `auto_broadcast` attribute is `none`. `src_0` and `src_1` shapes can be
different and auto-broadcasting is allowed if the `auto_broadcast` attribute
is `numpy`. Broadcasting is performed according to `auto_broadcast` value.

### Output

| Index | Argument Name | Required or Optional |
|:------| --------------|:---------------------|
| 0 | `dst` | Required |

## Supported Data Types

The GreaterEqual operation supports the following data type combinations.

| Src_0 / Src_1 | Dst |
|:--------------|:---------|
| f32 | boolean |
| bf16 | boolean |
| f16 | boolean |
| s32 | boolean |

0 comments on commit d9e07d7

Please sign in to comment.