# tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs

`#include <training_ops.h>`

Optional attribute setters for [ResourceSparseApplyKerasMomentum](https://www.tensorflow.org/versions/r2.12/api_docs/cc/class/tensorflow/ops/resource-sparse-apply-keras-momentum#classtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum).

## Summary

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r2.12/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs_1af942b37368dcb9f480e43927a742009c = false` | `bool` |
| `https://www.tensorflow.org/versions/r2.12/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs_1ad11f6bd6b9236d5fe221cc763557a0a2 = false` | `bool` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/versions/r2.12/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs_1a4edca02f2dc417b32e2c08ba79e73d2a(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.12/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs` If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. |
| `https://www.tensorflow.org/versions/r2.12/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs_1a8204904aac23a8290d68a339d6708813(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.12/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-keras-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_keras_momentum_1_1_attrs` If `True`, the tensor passed to compute grad will be var + momentum \* accum, so in the end, the var you get is actually var + momentum \* accum. |

## Public attributes

### use_locking_

```
bool tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs::use_locking_ = false
```

### use_nesterov_

```
bool tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs::use_nesterov_ = false
```

## Public functions

### UseLocking

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs::UseLocking(
  bool x
)
```
If `True`, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.

Defaults to false

### UseNesterov

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyKerasMomentum::Attrs::UseNesterov(
  bool x
)
```
If `True`, the tensor passed to compute grad will be var + momentum \* accum, so in the end, the var you get is actually var + momentum \* accum.

Defaults to false