Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
dòng chảy căng:: ôi:: Khôi phụcV2
#include <io_ops.h>
Khôi phục các tensor từ điểm kiểm tra V2.
Bản tóm tắt
Để tương thích ngược với định dạng V1, Op này hiện cũng cho phép khôi phục từ điểm kiểm tra V1:
- Op này trước tiên cố gắng tìm tệp chỉ mục V2 được trỏ đến bởi "tiền tố" và nếu tìm thấy, hãy tiếp tục đọc nó dưới dạng điểm kiểm tra V2;
- Nếu không thì đường dẫn đọc V1 sẽ được gọi. Không nên dựa vào hành vi này vì khả năng quay lại đọc V1 có thể không được dùng nữa và cuối cùng bị loại bỏ.
Theo mặc định, khôi phục đầy đủ các tenxơ được đặt tên. Nếu lệnh gọi muốn khôi phục các lát cụ thể của tensor được lưu trữ, "shape_and_slices" phải là các chuỗi không trống và được định dạng đúng tương ứng.
Người gọi phải đảm bảo tất cả các tenxơ được đặt tên thực sự được lưu trữ trong trạm kiểm soát.
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- tiền tố: Phải có một phần tử duy nhất. Tiền tố của điểm kiểm tra V2.
- tensor_names: hình dạng {N}. Tên của các tensor cần được khôi phục.
- shape_and_slices: hình dạng {N}. Thông số kỹ thuật lát cắt của tensor sẽ được khôi phục. Các chuỗi trống biểu thị rằng chúng là các tensor không được phân vùng.
- dtypes: hình dạng {N}. Danh sách dtype dự kiến cho các tensor. Phải khớp với những gì được lưu trữ trong trạm kiểm soát.
Trả về:
-
OutputList
: hình dạng {N}. Các tensor được khôi phục, có hình dạng được đọc trực tiếp từ điểm kiểm tra.
Chức năng công cộng |
---|
operator[] (size_t index) const | |
Thuộc tính công khai
Chức năng công cộng
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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```"]]