# tensorflow::ops::Assign::Attrs Struct Reference

# tensorflow::ops::Assign::Attrs

`#include <state_ops.h>`

Optional attribute setters for [Assign](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/assign#classtensorflow_1_1ops_1_1_assign).

## Summary

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs_1ae9bf9c16623a4261e299eb784f104eb4 = true` | `bool` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs_1a3401025d0470b42ec167e96408de3091 = true` | `bool` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs_1a0d9dfa31afce496359a0994b6c1e43ea(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs` If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs_1a6c63cacd6cce8eabbbb01ffd3ca16746(bool x)` | `TF_MUST_USE_RESULT https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/assign/attrs#structtensorflow_1_1ops_1_1_assign_1_1_attrs` If true, the operation will validate that the shape of 'value' matches the shape of the [Tensor](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) being assigned to. |

## Public attributes

### use_locking_

```
bool tensorflow::ops::Assign::Attrs::use_locking_ = true
```

### validate_shape_

```
bool tensorflow::ops::Assign::Attrs::validate_shape_ = true
```

## Public functions

### UseLocking

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::Assign::Attrs::UseLocking(
  bool x
)
```
If True, the assignment will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.

Defaults to true

### ValidateShape

```
TF_MUST_USE_RESULT Attrs tensorflow::ops::Assign::Attrs::ValidateShape(
  bool x
)
```
If true, the operation will validate that the shape of 'value' matches the shape of the [Tensor](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) being assigned to.

If false, 'ref' will take on the shape of 'value'.

Defaults to true