جریان تنسور:: عملیات:: RestoreV2
#include <io_ops.h>
تانسورها را از یک ایست بازرسی V2 بازیابی می کند.
خلاصه
برای سازگاری با فرمت V1، این Op در حال حاضر امکان بازیابی از یک چک پوینت V1 را نیز فراهم می کند:
- این عملیات ابتدا سعی می کند فایل فهرست V2 را که با "پیشوند" به آن اشاره شده است، پیدا کند، و اگر یافت شد، آن را به عنوان یک چک پوینت V2 بخوانید.
- در غیر این صورت مسیر خواندن V1 فراخوانی می شود. تکیه بر این رفتار توصیه نمی شود، زیرا امکان بازگشت به خواندن V1 ممکن است منسوخ شده و در نهایت حذف شود.
به طور پیش فرض، تانسورهای نامگذاری شده را به طور کامل بازیابی می کند. اگر تماسگیرنده بخواهد برشهای خاصی از تانسورهای ذخیرهشده را بازیابی کند، «شکل_و_برشها» باید رشتههای خالی و متناسب با آن شکل خوبی داشته باشند.
تماس گیرندگان باید مطمئن شوند که تمام تانسورهای نام برده واقعاً در ایست بازرسی ذخیره شده اند.
استدلال ها:
- scope: یک شی Scope
- پیشوند: باید یک عنصر واحد داشته باشد. پیشوند یک ایست بازرسی V2.
- tensor_names: شکل {N}. نام تانسورهایی که باید بازسازی شوند.
- shape_and_slices: shape {N}. مشخصات برش تانسورهایی که باید بازیابی شوند. رشته های خالی نشان می دهد که آنها تانسورهای تقسیم نشده هستند.
- dtypes: شکل {N}. فهرست نوع d مورد انتظار برای تانسورها. باید با موارد ذخیره شده در ایست بازرسی مطابقت داشته باشد.
برمیگرداند:
-
OutputList
: شکل {N}. تانسورهای بازسازی شده، که اشکال آنها مستقیماً از ایستگاه بازرسی خوانده می شود.
صفات عمومی
عملیات
Operation operation
تانسورها
::tensorflow::OutputList tensors
توابع عمومی
RestoreV2
RestoreV2(
const ::tensorflow::Scope & scope,
::tensorflow::Input prefix,
::tensorflow::Input tensor_names,
::tensorflow::Input shape_and_slices,
const DataTypeSlice & dtypes
)
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-26 بهوقت ساعت هماهنگ جهانی."],[],[],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```"]]