tf.raw_ops.TemporaryVariable
bookmark_borderbookmark
Stay organized with collections
Save and categorize content based on your preferences.
Returns a tensor that may be mutated, but only persists within a single step.
View aliases
Compat aliases for migration
See
Migration guide for
more details.
tf.compat.v1.raw_ops.TemporaryVariable
tf.raw_ops.TemporaryVariable(
shape, dtype, var_name='', name=None
)
This is an experimental op for internal use only and it is possible to use this
op in unsafe ways. DO NOT USE unless you fully understand the risks.
It is the caller's responsibility to ensure that 'ref' is eventually passed to a
matching 'DestroyTemporaryVariable' op after all other uses have completed.
Outputs a ref to the tensor state so it may be read or modified.
E.g.
var = state_ops._temporaryvariable([1, 2], types.float)
var_name = var.op.name
var = state_ops.assign(var, [[4.0, 5.0]])
var = state_ops.assign_add(var, [[6.0, 7.0]])
final = state_ops._destroy_temporary_variable(var, var_name=var_name)
Args |
shape
|
A tf.TensorShape or list of ints .
The shape of the variable tensor.
|
dtype
|
A tf.DType . The type of elements in the variable tensor.
|
var_name
|
An optional string . Defaults to "" .
Overrides the name used for the temporary variable resource. Default
value is the name of the 'TemporaryVariable' op (which is guaranteed unique).
|
name
|
A name for the operation (optional).
|
Returns |
A mutable Tensor of type dtype .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.TemporaryVariable\n\n\u003cbr /\u003e\n\nReturns a tensor that may be mutated, but only persists within a single step.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.TemporaryVariable`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/TemporaryVariable)\n\n\u003cbr /\u003e\n\n tf.raw_ops.TemporaryVariable(\n shape, dtype, var_name='', name=None\n )\n\nThis is an experimental op for internal use only and it is possible to use this\nop in unsafe ways. DO NOT USE unless you fully understand the risks.\n\nIt is the caller's responsibility to ensure that 'ref' is eventually passed to a\nmatching 'DestroyTemporaryVariable' op after all other uses have completed.\n\nOutputs a ref to the tensor state so it may be read or modified.\n\nE.g.\nvar = state_ops._temporary*variable(\\[1, 2\\], types.float*)\nvar_name = var.op.name\nvar = state_ops.assign(var, \\[\\[4.0, 5.0\\]\\])\nvar = state_ops.assign_add(var, \\[\\[6.0, 7.0\\]\\])\nfinal = state_ops._destroy_temporary_variable(var, var_name=var_name)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `shape` | A [`tf.TensorShape`](../../tf/TensorShape) or list of `ints`. The shape of the variable tensor. |\n| `dtype` | A [`tf.DType`](../../tf/dtypes/DType). The type of elements in the variable tensor. |\n| `var_name` | An optional `string`. Defaults to `\"\"`. Overrides the name used for the temporary variable resource. Default value is the name of the 'TemporaryVariable' op (which is guaranteed unique). |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A mutable `Tensor` of type `dtype`. ||\n\n\u003cbr /\u003e"]]