컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: 복원V2
#include <io_ops.h>
V2 체크포인트에서 텐서를 복원합니다.
요약
V1 형식과의 이전 버전 호환성을 위해 이 작업은 현재 V1 체크포인트에서도 복원을 허용합니다.
- 이 작업은 먼저 "접두사"가 가리키는 V2 인덱스 파일을 찾으려고 시도하고, 발견되면 계속해서 V2 체크포인트로 읽습니다.
- 그렇지 않으면 V1 읽기 경로가 호출됩니다. V1 읽기로 대체하는 기능은 더 이상 사용되지 않고 결국 제거될 수 있으므로 이 동작에 의존하는 것은 권장되지 않습니다.
기본적으로 명명된 텐서 전체를 복원합니다. 호출자가 저장된 텐서의 특정 조각을 복원하려는 경우 "shape_and_slices"는 비어 있지 않은 문자열이어야 하며 그에 따라 올바른 형식이어야 합니다.
호출자는 명명된 모든 텐서가 실제로 체크포인트에 저장되어 있는지 확인해야 합니다.
인수:
- 범위: 범위 개체
- 접두사: 단일 요소가 있어야 합니다. V2 체크포인트의 접두사입니다.
- tensor_names: 모양 {N}. 복원할 텐서의 이름입니다.
- Shape_and_slices: 모양 {N}. 복원할 텐서의 슬라이스 사양입니다. 빈 문자열은 분할되지 않은 텐서임을 나타냅니다.
- dtypes: 모양 {N}. 텐서에 대해 예상되는 dtype 목록입니다. 체크포인트에 저장된 것과 일치해야 합니다.
보고:
-
OutputList
: 모양 {N}. 체크포인트에서 직접 모양을 읽어오는 복원된 텐서입니다.
공개 속성
공공 기능
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[],[],null,["# tensorflow::ops::RestoreV2 Class Reference\n\ntensorflow::ops::RestoreV2\n==========================\n\n`#include \u003cio_ops.h\u003e`\n\nRestores tensors from a V2 checkpoint.\n\nSummary\n-------\n\nFor backward compatibility with the V1 format, this Op currently allows restoring from a V1 checkpoint as well:\n\n- This Op first attempts to find the V2 index file pointed to by \"prefix\", and if found proceed to read it as a V2 checkpoint;\n- Otherwise the V1 read path is invoked. Relying on this behavior is not recommended, as the ability to fall back to read V1 might be deprecated and eventually removed.\n\n\u003cbr /\u003e\n\nBy default, restores the named tensors in full. If the caller wishes to restore specific slices of stored tensors, \"shape_and_slices\" should be non-empty strings and correspondingly well-formed.\n\nCallers must ensure all the named tensors are indeed stored in the checkpoint.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- prefix: Must have a single element. The prefix of a V2 checkpoint.\n- tensor_names: shape {N}. The names of the tensors to be restored.\n- shape_and_slices: shape {N}. The slice specs of the tensors to be restored. [Empty](/versions/r1.15/api_docs/cc/class/tensorflow/ops/empty#classtensorflow_1_1ops_1_1_empty) strings indicate that they are non-partitioned tensors.\n- dtypes: shape {N}. The list of expected dtype for the tensors. Must match those stored in the checkpoint.\n\n\u003cbr /\u003e\n\nReturns:\n\n- `OutputList`: shape {N}. The restored tensors, whose shapes are read from the checkpoint directly.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [RestoreV2](#classtensorflow_1_1ops_1_1_restore_v2_1a57bca4a84e5b10e9920fdeeac3a05f5e)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` prefix, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` tensor_names, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` shape_and_slices, const DataTypeSlice & dtypes)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_restore_v2_1ac15e029a658d659cfed51e641fd25034) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [tensors](#classtensorflow_1_1ops_1_1_restore_v2_1acec293134264696f9ac7e0f1d900d542) | `::`[tensorflow::OutputList](/versions/r1.15/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operator[]](#classtensorflow_1_1ops_1_1_restore_v2_1a6bd9fcb0de236ef33532417834b3ed0d)`(size_t index) const ` | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### tensors\n\n```text\n::tensorflow::OutputList tensors\n``` \n\nPublic functions\n----------------\n\n### RestoreV2\n\n```gdscript\n RestoreV2(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input prefix,\n ::tensorflow::Input tensor_names,\n ::tensorflow::Input shape_and_slices,\n const DataTypeSlice & dtypes\n)\n``` \n\n### operator\\[\\]\n\n```gdscript\n::tensorflow::Output operator[](\n size_t index\n) const \n```"]]