# tensorflow::ops::TopK::Attrs

`#include <nn_ops.h>`

Optional attribute setters for [TopK](https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/top-k#classtensorflow_1_1ops_1_1_top_k).

## Summary

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/top-k/attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs_1a0ce5dbbb461fb199fc8064e46db73b98 = DT_INT32` | `DataType` |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/top-k/attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs_1abbbe7daa73e35807a6e801d71818d7d6 = true` | `bool` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/top-k/attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs_1a60cf8d02b3b34ac440177fdad80c591e(DataType x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/top-k/attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs` Defaults to DT_INT32. |
| `https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/top-k/attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs_1ae56fc99e004be4f8fc11ecaefb1bedc4(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/top-k/attrs#structtensorflow_1_1ops_1_1_top_k_1_1_attrs` If true the resulting `k` elements will be sorted by the values in descending order. |

## Public attributes

### index_type_

```
DataType tensorflow::ops::TopK::Attrs::index_type_ = DT_INT32
```

### sorted_

```
bool tensorflow::ops::TopK::Attrs::sorted_ = true
```

## Public functions

### IndexType

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::TopK::Attrs::IndexType(
  DataType x
)
```
Defaults to DT_INT32.

### Sorted

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::TopK::Attrs::Sorted(
  bool x
)
```
If true the resulting `k` elements will be sorted by the values in descending order.

Defaults to true