# Supported Functions
Blank: Upcoming support
✓: Supported
✗: Not supported
## DType
| 16-bit floating point | `maidenx::bfloat16` |
| 16-bit floating point | `maidenx::float16` or `maidenx::half` |
| 32-bit floating point | `maidenx::float32` |
| 64-bit floating point | `maidenx::float64` |
| boolean | `maidenx::bool` |
| 8-bit integer (unsigned) | `maidenx::uint8` |
| 16-bit integer (unsigned) | not supported |
| 32-bit integer (unsigned) | `maidenx::uint32` |
| 64-bit integer (unsigned) | not supported |
| 8-bit integer (signed) | `maidenx::int8` |
| 16-bit integer (signed) | not supported |
| 32-bit integer (signed) | `maidenx::int32` |
| 64-bit integer (signed) | `maidenx::int64` |
> [!NOTE]
> The boolean type in the MaidenX framework is promoted based on the type of operation:
>
> - For logical operations: Remains as maidenx::bool
> - For arithmetic operations: Promoted to maidenx::uint8 (8-bit unsigned integer)
> - For operations involving floating-point numbers: Promoted to maidenx::float32 (32-bit floating point)
>
> This conversion happens automatically in the framework to ensure type compatibility during different operations, as boolean values (true/false) need to be represented as numeric values (1/0) when used in mathematical contexts.
<br/>
## Tensor
### Tensor Operations
| **Binary Operations** |
| | `add` | ✓ | ✓ | ✓ |
| | `sub` | ✓ | ✓ | ✓ |
| | `mul` | ✓ | ✓ | ✓ |
| | `div` | ✓ | ✓ | ✓ |
| | `maximum` | ✓ | ✓ | ✓ |
| | `minimum` | ✓ | ✓ | ✓ |
| logical operations |
| | `logical_and` | ✗ | ✓ | ✓ |
| | `logical_or` | ✗ | ✓ | ✓ |
| | `logical_xor` | ✗ | ✓ | ✓ |
| comparison operations |
| | `eq` | ✗ | ✓ | ✓ |
| | `ne` | ✗ | ✓ | ✓ |
| | `lt` | ✗ | ✓ | ✓ |
| | `le` | ✗ | ✓ | ✓ |
| | `gt` | ✗ | ✓ | ✓ |
| | `ge` | ✗ | ✓ | ✓ |
| matrix multiplication |
| | `matmul` | ✓ | ✓ | ✓ |
| in-place |
| | `add_` | ✗ | ✓ | ✓ |
| | `sub_` | ✗ | ✓ | ✓ |
| | `mul_` | ✗ | ✓ | ✓ |
| | `div_` | ✗ | ✓ | ✓ |
| **Unary Operations** |
| | `neg` | ✓ | ✓ | ✓ |
| | `abs` | ✓ | ✓ | ✓ |
| | `sign` | ✗ | ✓ | ✓ |
| | `square` | ✓ | ✓ | ✓ |
| | `sqrt` | ✓ | ✓ | ✓ |
| | `relu` | ✓ | ✓ | ✓ |
| | `sigmoid` | ✓ | ✓ | ✓ |
| | `tanh` | ✓ | ✓ | ✓ |
| | `gelu` | ✓ | ✓ | ✓ |
| | `sin` | ✓ | ✓ | ✓ |
| | `cos` | ✓ | ✓ | ✓ |
| | `tan` | ✓ | ✓ | ✓ |
| | `ln` | ✓ | ✓ | ✓ |
| | `log` (ln alias) | ✓ | ✓ | ✓ |
| | `log10` | ✓ | ✓ | ✓ |
| | `log2` | ✓ | ✓ | ✓ |
| | `exp` | ✓ | ✓ | ✓ |
| | `exp10` | ✓ | ✓ | ✓ |
| | `exp2` | ✓ | ✓ | ✓ |
| | `softplus` | ✓ | ✓ | ✓ |
| | `recip` | ✓ | ✓ | ✓ |
| logical operations |
| | `logical_not` | ✗ | ✓ | ✓ |
| with constant |
| | `add_scalar` | ✓ | ✓ | ✓ |
| | `sub_scalar` | ✓ | ✓ | ✓ |
| | `mul_scalar` | ✓ | ✓ | ✓ |
| | `div_scalar` | ✓ | ✓ | ✓ |
| | `maximum_scalar` | ✓ | ✓ | ✓ |
| | `minimum_scalar` | ✓ | ✓ | ✓ |
| | `pow` | ✓ | ✓ | ✓ |
| | `leaky_relu` | ✓ | ✓ | ✓ |
| | `elu` | ✓ | ✓ | ✓ |
| comparison operations |
| | `eq_scalar` | ✗ | ✓ | ✓ |
| | `ne_scalar` | ✗ | ✓ | ✓ |
| | `lt_scalar` | ✗ | ✓ | ✓ |
| | `le_scalar` | ✗ | ✓ | ✓ |
| | `gt_scalar` | ✗ | ✓ | ✓ |
| | `ge_scalar` | ✗ | ✓ | ✓ |
| **Reduction Operations** |
| | `sum` | ✓ | ✓ | ✓ |
| | `sum_all` | ✓ | ✓ | ✓ |
| | `sum_to_shape` | ✓ | ✓ | ✓ |
| | `mean` | ✓ | ✓ | ✓ |
| | `mean_all` | ✓ | ✓ | ✓ |
| | `fold` | ✓ | ✓ | ✓ |
| | `max` | ✓ | ✓ | ✓ |
| | `min` | ✓ | ✓ | ✓ |
| **Transform Operations** |
| view operations |
| | `view` | ✓ | ✓ | ✓ |
| | `squeeze` | ✓ | ✓ | ✓ |
| | `squeeze_all` | ✓ | ✓ | ✓ |
| | `unsqueeze` | ✓ | ✓ | ✓ |
| | `transpose` | ✓ | ✓ | ✓ |
| | `slice` | ✓ | ✓ | ✓ |
| | `unfold` | ✓ | ✓ | ✓ |
| reshape operations |
| | `reshape` | ✓ | ✓ | ✓ |
| broadcast operations |
| | `broadcast` | ✓ | ✓ | ✓ |
| | `broadcast_like` | ✓ | ✓ | ✓ |
| | `broadcast_left` | ✓ | ✓ | ✓ |
| **Padding Operations** |
| | `pad` | ✓ | ✓ | ✓ |
| | `pad_with_constant` | ✓ | ✓ | ✓ |
| | `pad_with_reflection` | ✓ | ✓ | ✓ |
| | `pad_with_replication` | ✓ | ✓ | ✓ |
| **Indexing Operations** |
| | `gather` | ✓ | ✓ | ✓ |
| | `scatter_add_` | ✗ | ✓ | ✓ |
| **NN Layer Aliases** |
| activation |
| | `softmax` | ✓ | ✓ | ✓ |
<br/>
### Tensor Functions
| **Util Functions** |
| | `is_contiguous` | ✓ | ✓ |
| | `contiguous` | ✓ | ✓ |
| | `to_flatten_vec` | ✓ | ✓ |
| | `get` | ✓ | ✓ |
| | `set` | ✓ | ✓ |
| | `select` | ✓ | ✓ |
| | `item` | ✓ | ✓ |
<br/>
## Neural Networks
### Layers
| **Linear Layers** |
| | `Linear` | ✓ | ✓ |
| **Convolution Layers** |
| | `Conv2d` | ✓ | ✓ |
| **Normalization Layers** |
| | `LayerNorm` | ✓ | ✓ |
| **Dropout Layers** |
| | `Dropout` | ✓ | ✓ |
| **Activation Layers** |
| | `Softmax` | ✓ | ✓ |
| tensor ops aliases |
| | `ReLU` | ✓ | ✓ |
| | `Sigmoid` | ✓ | ✓ |
| | `Tanh` | ✓ | ✓ |
| | `LeakyReLU` | ✓ | ✓ |
| | `GELU` | ✓ | ✓ |
| | `ELU` | ✓ | ✓ |
<br/>
### Loss Layers
| | `Huber` | ✓ | ✓ |
| | `MAE` | ✓ | ✓ |
| | `MSE` | ✓ | ✓ |
| | `CrossEntropyLoss` | ✓ | ✓ |
<br/>
### Optimizer
| | `Adam` | ✓ | ✓ |
| | `SGD` | ✓ | ✓ |