컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: 임시변수
#include <state_ops.h>
변경될 수 있지만 단일 단계 내에서만 지속되는 텐서를 반환합니다.
요약
이는 내부용으로만 사용되는 실험적인 작업이며 이 작업을 안전하지 않은 방식으로 사용할 수 있습니다. 위험을 완전히 이해하지 못하면 사용하지 마십시오.
다른 모든 사용이 완료된 후 'ref'가 결국 일치하는 ' DestroyTemporaryVariable ' 작업에 전달되도록 하는 것은 호출자의 책임입니다.
읽거나 수정할 수 있도록 텐서 상태에 대한 참조를 출력합니다.
예: var = state_ops._temporary_variable([1, 2], type.float_) var_name = var.op.name var = state_ops.sign(var, [[4.0, 5.0]]) var = state_ops.sign_add(var, [[ 6.0, 7.0]]) 최종 = state_ops._destroy_temporary_variable(var, var_name=var_name)
인수:
- 범위: 범위 개체
- 모양: 가변 텐서의 모양입니다.
- dtype: 변수 텐서의 요소 유형입니다.
선택적 속성( Attrs
참조):
보고:
공개 속성
공공 기능
임시변수
TemporaryVariable(
const ::tensorflow::Scope & scope,
PartialTensorShape shape,
DataType dtype
)
마디
::tensorflow::Node * node() const
operator::tensorflow::Input() const
연산자::텐서플로우::출력
operator::tensorflow::Output() const
공개 정적 함수
변수 이름
Attrs VarName(
StringPiece x
)
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# tensorflow::ops::TemporaryVariable Class Reference\n\ntensorflow::ops::TemporaryVariable\n==================================\n\n`#include \u003cstate_ops.h\u003e`\n\nReturns a tensor that may be mutated, but only persists within a single step.\n\nSummary\n-------\n\nThis 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.\n\nIt is the caller's responsibility to ensure that 'ref' is eventually passed to a matching '[DestroyTemporaryVariable](/versions/r2.1/api_docs/cc/class/tensorflow/ops/destroy-temporary-variable#classtensorflow_1_1ops_1_1_destroy_temporary_variable)' 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. var = state_ops._temporary_variable(\\[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)\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- shape: The shape of the variable tensor.\n- dtype: The type of elements in the variable tensor.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/temporary-variable/attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs)):\n\n- var_name: Overrides the name used for the temporary variable resource. Default value is the name of the '[TemporaryVariable](/versions/r2.1/api_docs/cc/class/tensorflow/ops/temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable)' op (which is guaranteed unique).\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A reference to the variable tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [TemporaryVariable](#classtensorflow_1_1ops_1_1_temporary_variable_1a694e6c48eaf39d57f59d52796a9a71d1)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, PartialTensorShape shape, DataType dtype)` ||\n| [TemporaryVariable](#classtensorflow_1_1ops_1_1_temporary_variable_1a43909369fdad702faf95e5aab8346b1a)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, PartialTensorShape shape, DataType dtype, const `[TemporaryVariable::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/temporary-variable/attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_temporary_variable_1abf90e66f914f45a8e9c11f7409917423) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [ref](#classtensorflow_1_1ops_1_1_temporary_variable_1a62601e5fd1b28bd28a6f0db0c691fe61) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_temporary_variable_1a3dbe9a732d4ec4ab4f94240c0ba61210)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_temporary_variable_1a8414b80274ac7ca395a565b59e90cd9e)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_temporary_variable_1a62b24d2f958c91a5a1005127d7056dc9)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| [VarName](#classtensorflow_1_1ops_1_1_temporary_variable_1a6647c19d0e761d2c6c11ff667576cfb5)`(StringPiece x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/temporary-variable/attrs#structtensorflow_1_1ops_1_1_temporary_variable_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::TemporaryVariable::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/temporary-variable/attrs) | Optional attribute setters for [TemporaryVariable](/versions/r2.1/api_docs/cc/class/tensorflow/ops/temporary-variable#classtensorflow_1_1ops_1_1_temporary_variable). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### ref\n\n```text\n::tensorflow::Output ref\n``` \n\nPublic functions\n----------------\n\n### TemporaryVariable\n\n```gdscript\n TemporaryVariable(\n const ::tensorflow::Scope & scope,\n PartialTensorShape shape,\n DataType dtype\n)\n``` \n\n### TemporaryVariable\n\n```gdscript\n TemporaryVariable(\n const ::tensorflow::Scope & scope,\n PartialTensorShape shape,\n DataType dtype,\n const TemporaryVariable::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### VarName\n\n```text\nAttrs VarName(\n StringPiece x\n)\n```"]]