# tensorflow::ops::ResourceApplyMomentum::Attrs Struct Reference

# tensorflow::
ops::
ResourceApplyMomentum::
Attrs

`
#include <training_ops.h>
`


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

## Summary

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

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/resource-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs_1a27048186d5da716199c710dd02f5175b (bool x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/resource-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_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-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_apply_momentum_1_1_attrs_1aaed047b37f6fea17e9215418172c1b8e (bool x) ` | ` TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.6/api_docs/cc/struct/tensorflow/ops/resource-apply-momentum/attrs#structtensorflow_1_1ops_1_1_resource_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::ResourceApplyMomentum::Attrs::use_locking_ = false
```

### use_nesterov_

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

## Public functions

### UseLocking

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