จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: คิวDequeueUpTo
#include <data_flow_ops.h>
แยกสิ่งอันดับ n
ของเทนเซอร์ตั้งแต่หนึ่งตัวขึ้นไปออกจากคิวที่กำหนด
สรุป
การดำเนินการนี้ไม่รองรับทุกคิว หากคิวไม่รองรับ DequeueUpTo แสดงว่าข้อผิดพลาด Unimplemented ถูกส่งกลับ
หากคิวถูกปิดและมีองค์ประกอบมากกว่า 0 แต่น้อยกว่า n
องค์ประกอบ แทนที่จะส่งคืนข้อผิดพลาด OutOfRange เช่น QueueDequeueMany กลับน้อยกว่า n
องค์ประกอบทันที หากคิวถูกปิดและมีองค์ประกอบเหลือ 0 รายการในคิว ข้อผิดพลาด OutOfRange จะถูกส่งกลับเช่นเดียวกับใน QueueDequeueMany มิฉะนั้นพฤติกรรมจะเหมือนกับ QueueDequeueMany :
การดำเนินการนี้จะเชื่อมเทนเซอร์ส่วนประกอบองค์ประกอบคิวเข้าด้วยกันตามมิติที่ 0 เพื่อสร้างเทนเซอร์ส่วนประกอบเดียว ส่วนประกอบ ทั้งหมด ในทูเพิลที่แยกออกจากคิวจะมีขนาด n ในมิติที่ 0
การดำเนินการนี้มีเอาต์พุต k
โดยที่ k
คือจำนวนส่วนประกอบในทูเพิลที่จัดเก็บไว้ในคิวที่กำหนด และเอาต์พุต i
คือองค์ประกอบที่ i ของทูเพิลที่แยกออกจากคิว
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- หมายเลขอ้างอิง: หมายเลขอ้างอิงของคิว
- n: จำนวนสิ่งอันดับที่จะแยกคิว
- component_types: ประเภทของแต่ละองค์ประกอบในทูเพิล
แอ็ตทริบิวต์ทางเลือก (ดู Attrs
):
- timeout_ms: หากคิวมีองค์ประกอบน้อยกว่า n การดำเนินการนี้จะบล็อกเป็นเวลาสูงสุด timeout_ms มิลลิวินาที หมายเหตุ: ยังไม่รองรับตัวเลือกนี้
ผลตอบแทน:
-
OutputList
: เทนเซอร์อย่างน้อยหนึ่งตัวที่ถูกแยกออกจากคิวเป็นสิ่งทูเพิล
คุณลักษณะสาธารณะ
งานสาธารณะ
ฟังก์ชันคงที่สาธารณะ
หมดเวลาMs
Attrs TimeoutMs(
int64 x
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[null,null,["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# tensorflow::ops::QueueDequeueUpTo Class Reference\n\ntensorflow::ops::QueueDequeueUpTo\n=================================\n\n`#include \u003cdata_flow_ops.h\u003e`\n\nDequeues `n` tuples of one or more tensors from the given queue.\n\nSummary\n-------\n\nThis operation is not supported by all queues. If a queue does not support DequeueUpTo, then an Unimplemented error is returned.\n\nIf the queue is closed and there are more than 0 but less than `n` elements remaining, then instead of returning an OutOfRange error like [QueueDequeueMany](/versions/r2.1/api_docs/cc/class/tensorflow/ops/queue-dequeue-many#classtensorflow_1_1ops_1_1_queue_dequeue_many), less than `n` elements are returned immediately. If the queue is closed and there are 0 elements left in the queue, then an OutOfRange error is returned just like in [QueueDequeueMany](/versions/r2.1/api_docs/cc/class/tensorflow/ops/queue-dequeue-many#classtensorflow_1_1ops_1_1_queue_dequeue_many). Otherwise the behavior is identical to [QueueDequeueMany](/versions/r2.1/api_docs/cc/class/tensorflow/ops/queue-dequeue-many#classtensorflow_1_1ops_1_1_queue_dequeue_many):\n\nThis operation concatenates queue-element component tensors along the 0th dimension to make a single component tensor. [All](/versions/r2.1/api_docs/cc/class/tensorflow/ops/all#classtensorflow_1_1ops_1_1_all) of the components in the dequeued tuple will have size n in the 0th dimension.\n\nThis operation has `k` outputs, where `k` is the number of components in the tuples stored in the given queue, and output `i` is the ith component of the dequeued tuple.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- handle: The handle to a queue.\n- n: The number of tuples to dequeue.\n- component_types: The type of each component in a tuple.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/queue-dequeue-up-to/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_up_to_1_1_attrs)):\n\n- timeout_ms: If the queue has fewer than n elements, this operation will block for up to timeout_ms milliseconds. Note: This option is not supported yet.\n\n\u003cbr /\u003e\n\nReturns:\n\n- `OutputList`: One or more tensors that were dequeued as a tuple.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [QueueDequeueUpTo](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1aca97813734e5ee8336249c2d1cee8630)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` handle, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` n, const DataTypeSlice & component_types)` ||\n| [QueueDequeueUpTo](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a6e43ee993ab5a91d42cf6bb2ae59a53f)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` handle, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` n, const DataTypeSlice & component_types, const `[QueueDequeueUpTo::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/queue-dequeue-up-to/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_up_to_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|\n| [components](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a0679388d38032e4520a34428aeae1a31) | `::`[tensorflow::OutputList](/versions/r2.1/api_docs/cc/group/core#group__core_1gab449e6a3abd500c2f4ea93f9e89ba96c) |\n| [operation](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a20f6d60f9d0837a67db6bd29d2078fad) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operator[]](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a30cf1d991c2f78f4edb53783d1bda37e)`(size_t index) const ` | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public static functions ||\n|------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [TimeoutMs](#classtensorflow_1_1ops_1_1_queue_dequeue_up_to_1a5a0258537ccd1cc274cd984b6f97a364)`(int64 x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/queue-dequeue-up-to/attrs#structtensorflow_1_1ops_1_1_queue_dequeue_up_to_1_1_attrs) |\n\n| ### Structs ||\n|------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::QueueDequeueUpTo::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/queue-dequeue-up-to/attrs) | Optional attribute setters for [QueueDequeueUpTo](/versions/r2.1/api_docs/cc/class/tensorflow/ops/queue-dequeue-up-to#classtensorflow_1_1ops_1_1_queue_dequeue_up_to). |\n\nPublic attributes\n-----------------\n\n### components\n\n```text\n::tensorflow::OutputList components\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### QueueDequeueUpTo\n\n```gdscript\n QueueDequeueUpTo(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input handle,\n ::tensorflow::Input n,\n const DataTypeSlice & component_types\n)\n``` \n\n### QueueDequeueUpTo\n\n```gdscript\n QueueDequeueUpTo(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input handle,\n ::tensorflow::Input n,\n const DataTypeSlice & component_types,\n const QueueDequeueUpTo::Attrs & attrs\n)\n``` \n\n### operator\\[\\]\n\n```gdscript\n::tensorflow::Output operator[](\n size_t index\n) const \n``` \n\nPublic static functions\n-----------------------\n\n### TimeoutMs\n\n```text\nAttrs TimeoutMs(\n int64 x\n)\n```"]]