# tensorflow::ops::SparseApplyMomentum::Attrs Struct Reference

# tensorflow::
ops::
SparseApplyMomentum::
Attrs

`
#include <training_ops.h>
`


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

## Summary

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

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs_1abc3258f90a307c2b8f7d1048201d7105 (bool x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_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/sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_sparse_apply_momentum_1_1_attrs_1acfa0a7c0ee380f32131c5395deba19b0 (bool x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/sparse-apply-momentum/attrs#structtensorflow_1_1ops_1_1_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::SparseApplyMomentum::Attrs::use_locking_ = false
```

### use_nesterov_

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

## Public functions

### UseLocking

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::SparseApplyMomentum::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::SparseApplyMomentum::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