# tf_agents.bandits.policies.constraints.BaseConstraint

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/bandits/policies/constraints.py#L38-L76) |

Abstract base class for representing constraints.

    tf_agents.bandits.policies.constraints.BaseConstraint(
        time_step_spec: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types#TimeStep,
        action_spec: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types#BoundedTensorSpec,
        name: Optional[Text] = None
    )

The constraint class provides feasibility computation functionality for
computing the probability of actions being feasible.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `time_step_spec` | A `TimeStep` spec of the expected time_steps. |
| `action_spec` | A nest of `BoundedTensorSpec` representing the actions. |
| `name` | Python str name of this constraint. |

<br />

## Methods

### `__call__`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/bandits/policies/constraints.py#L70-L76)

    @abc.abstractmethod
    __call__(
        observation: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedTensor,
        actions: Optional[types.Tensor] = None
    ) -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/Tensor

Returns the probability of input actions being feasible.