# tensorflow::ops::ResourceSparseApplyMomentum::Attrs Struct Reference

# tensorflow::
ops::
ResourceSparseApplyMomentum::
Attrs

`
#include <training_ops.h>
`


Optional attribute setters for
[ResourceSparseApplyMomentum](https://www.tensorflow.org/versions/r2.6/api_docs/cc/class/tensorflow/ops/resource-sparse-apply-momentum#classtensorflow_1_1ops_1_1_resource_sparse_apply_momentum)
.

## Summary

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs_1a827485c686efacdb60adc43db2cafe50 = false ` | ` bool ` |
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs_1ac513249f4083ebbdd225e272dcb3c91c = false ` | ` bool ` |

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs_1abf98d2e230a34b65f4f1293131a7c04d (bool x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_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.6/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs_1ae5c7eb0501d057c11a1354d4c86fb994 (bool x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_momentum_1_1_attrs ` If ` True ` , the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum. |

## Public attributes

### use_locking_

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

### use_nesterov_

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

## Public functions

### UseLocking

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::ResourceSparseApplyMomentum::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::ResourceSparseApplyMomentum::Attrs::UseNesterov(
  bool x
)
```

If
`
True
`
, the tensor passed to compute grad will be var - lr \* momentum \* accum, so in the end, the var you get is actually var - lr \* momentum \* accum.


Defaults to false