# tensorflow::ops::DestroyTemporaryVariable Class Reference

# tensorflow::ops::DestroyTemporaryVariable

`#include <state_ops.h>`

Destroys the temporary variable and returns its final value.

## Summary

Sets output to the value of the [Tensor](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) pointed to by 'ref', then destroys the temporary variable called 'var_name'. [All](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/all#classtensorflow_1_1ops_1_1_all) other uses of 'ref' *must* have executed before this op. This is typically achieved by chaining the ref through each assign op, or by using control dependencies.

Outputs the final value of the tensor pointed to by 'ref'.

Arguments:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- ref: A reference to the temporary variable tensor.
- var_name: Name of the temporary variable, usually the name of the matching '[TemporaryVariable](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable)' op.

<br />

Returns:

- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output`: The value tensor.

<br />

| ### Constructors and Destructors ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/destroy-temporary-variable#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a01f12d953d9078e0133345ecad76f629(const ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input ref, StringPiece var_name)` ||

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/destroy-temporary-variable#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a0bfa0ecb725488b9065e4dfa42addfdc` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/destroy-temporary-variable#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a2a3151dd005ff60e1fbc92d9f72c51d0` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |

| ### Public functions ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/destroy-temporary-variable#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1ab3002dc3d20c1e4e20f1fb219714c7e8() const ` | `::tensorflow::Node *` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/destroy-temporary-variable#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a36cd6c9de3fec498a9b6f32078402e1a() const ` | ` `` ` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/destroy-temporary-variable#classtensorflow_1_1ops_1_1_destroy_temporary_variable_1a94ad142b7443111409db522488894175() const ` | ` `` ` |

## Public attributes

### operation

```
Operation operation
```

### value

```
::tensorflow::Output value
```

## Public functions

### DestroyTemporaryVariable

```
 DestroyTemporaryVariable(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input ref,
  StringPiece var_name
)
```

### node

```
::tensorflow::Node * node() const 
```

### operator::tensorflow::Input

```
 operator::tensorflow::Input() const 
```

### operator::tensorflow::Output

```
 operator::tensorflow::Output() const 
```