# tflite_support.task.processor.CategoricalSlot

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/processor/proto/clu.proto) |

Represents a categorical slot whose values are within a finite set.

```python
tflite_support.task.processor.CategoricalSlot(
    slot: str,
    prediction: `tflite_support.task.processor.Category`
)
```

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `slot` | The name of the slot. |
| `prediction` | The predicted class. |

<br />

## Methods

### `create_from_pb2`

[View source](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/processor/proto/clu.proto)

```python
@classmethod
create_from_pb2(
    pb2_obj: _CategoricalSlotProto
) -> 'CategoricalSlot'
```

Creates a `CategoricalSlot` object from the given protobuf object.

### `to_pb2`

[View source](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/processor/proto/clu.proto)

```python
to_pb2() -> _CategoricalSlotProto
```

Generates a protobuf object to pass to the C++ layer.

### `__eq__`

[View source](https://github.com/tensorflow/tflite-support/blob/v0.4.4/tensorflow_lite_support/python/task/processor/proto/clu.proto)

```python
__eq__(
    other: Any
) -> bool
```

Checks if this object is equal to the given object.

<br />

<br />

<br />

| Args ||
|---|---|
| `other` | The object to be compared with. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| True if the objects are equal. ||

<br />