> This page is for version 5.1 (Latest) (default).
> For other versions, use one of these documentation indexes:
> - 5.1 (Latest) (default): https://docs.nvidia.com/holoscan/sdk-user-guide/5-1-latest/llms.txt
> - ltsb-2.0: https://docs.nvidia.com/holoscan/sdk-user-guide/ltsb-2-0/llms.txt
> - 5.0: https://docs.nvidia.com/holoscan/sdk-user-guide/5-0/llms.txt
> - 4.6: https://docs.nvidia.com/holoscan/sdk-user-guide/4-6/llms.txt
> - 4.5: https://docs.nvidia.com/holoscan/sdk-user-guide/4-5/llms.txt
> - 4.4: https://docs.nvidia.com/holoscan/sdk-user-guide/4-4/llms.txt
> - 4.3: https://docs.nvidia.com/holoscan/sdk-user-guide/4-3/llms.txt
> - Archives: https://docs.nvidia.com/holoscan/sdk-user-guide/archives/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.

# holoscan::TensorAlternative

> Describe one complete Tensor form that a port accepts or may emit.

Describe one complete [Tensor](../classes/tensor) form that a port accepts or may emit.

Facts within one alternative hold together; a port's alternatives form a union. Keep correlated facts, such as a dtype that applies only at one rank, in separate alternatives. A set-valued member admits each listed value independently of the other members.

The exact `representation.rank` and `ranks` are mutually exclusive, as are the exact `representation.dtype` and `dtypes`. Rank and dtype sets own their values.

```cpp showLineNumbers={false}
#include <holoscan/tensor_contract_types.hpp>
```

---

## Member variables

| Name             | Type                            | Description                                                                      |
| ---------------- | ------------------------------- | -------------------------------------------------------------------------------- |
| `representation` | `TensorRepresentation`          | [Exact](exact) facts of this form.                                               |
| `ranks`          | `TensorRankSet`                 | Admitted ranks; empty leaves rank exact.                                         |
| `dtypes`         | `TensorDtypeSet`                | Admitted element types; empty leaves dtype exact.                                |
| `bounds`         | `std::optional< TensorBounds >` | Optional logical bounds of this form. Mutually exclusive with spec-level bounds. |