จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: เทนเซอร์อาร์เรย์:: คุณสมบัติ
#include <data_flow_ops.h>
ตัวตั้งค่าแอตทริบิวต์เพิ่มเติมสำหรับ TensorArray
สรุป
คุณลักษณะสาธารณะ
เคลียร์_หลัง_อ่าน_
bool tensorflow::ops::TensorArray::Attrs::clear_after_read_ = true
ไดนามิก_ขนาด_
bool tensorflow::ops::TensorArray::Attrs::dynamic_size_ = false
องค์ประกอบ_รูปร่าง_
PartialTensorShape tensorflow::ops::TensorArray::Attrs::element_shape_ = ::tensorflow::PartialTensorShape()
เหมือนกัน_องค์ประกอบ_รูปร่าง_
bool tensorflow::ops::TensorArray::Attrs::identical_element_shapes_ = false
เทนเซอร์_อาร์เรย์_ชื่อ_
StringPiece tensorflow::ops::TensorArray::Attrs::tensor_array_name_ = ""
งานสาธารณะ
ล้างหลังจากอ่าน
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::ClearAfterRead(
bool x
)
หากเป็นจริง (ค่าเริ่มต้น) เทนเซอร์ใน TensorArray จะถูกล้างหลังจากอ่านแล้ว
สิ่งนี้จะปิดใช้งานซีแมนทิกส์การอ่านหลายรายการ แต่อนุญาตให้ปล่อยหน่วยความจำล่วงหน้าได้
ค่าเริ่มต้นเป็นจริง
ขนาดไดนามิก
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::DynamicSize(
bool x
)
บูลีนที่กำหนดว่าจะอนุญาตให้เขียนไปยัง TensorArray เพื่อเพิ่มขนาดหรือไม่
โดยค่าเริ่มต้น สิ่งนี้ไม่ได้รับอนุญาต
ค่าเริ่มต้นเป็นเท็จ
องค์ประกอบรูปร่าง
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::ElementShape(
PartialTensorShape x
)
รูปร่างที่คาดหวังขององค์ประกอบ หากทราบ
ใช้เพื่อตรวจสอบรูปร่างขององค์ประกอบ TensorArray หากไม่ได้ระบุรูปร่างนี้อย่างสมบูรณ์ การรวบรวม TensorArrays ขนาดศูนย์ถือเป็นข้อผิดพลาด
ค่าเริ่มต้นเป็น
รูปร่างองค์ประกอบที่เหมือนกัน
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::IdenticalElementShapes(
bool x
)
หากเป็นจริง (ค่าเริ่มต้นคือเท็จ) องค์ประกอบทั้งหมดใน TensorArray จะต้องมีรูปร่างเหมือนกัน
ซึ่งช่วยให้เกิดพฤติกรรมบางอย่างได้ เช่น การตรวจสอบรูปร่างที่สอดคล้องกันแบบไดนามิกในการเขียน และความสามารถในการเติมเทนเซอร์ศูนย์ที่มีรูปทรงอย่างเหมาะสมบนสแต็ก แม้ว่าแอตทริบิวต์ element_shape จะไม่ได้กำหนดไว้อย่างสมบูรณ์ก็ตาม
ค่าเริ่มต้นเป็นเท็จ
TensorArrayName
TF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::TensorArrayName(
StringPiece x
)
แทนที่ชื่อที่ใช้สำหรับทรัพยากร tensor_array ชั่วคราว
ค่าเริ่มต้นคือชื่อของ op ' TensorArray ' (ซึ่งรับประกันว่าไม่ซ้ำกัน)
ค่าเริ่มต้นเป็น ""
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["# tensorflow::ops::TensorArray::Attrs Struct Reference\n\ntensorflow::ops::TensorArray::Attrs\n===================================\n\n`#include \u003cdata_flow_ops.h\u003e`\n\nOptional attribute setters for [TensorArray](/versions/r2.1/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array).\n\nSummary\n-------\n\n| ### Public attributes ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|\n| [clear_after_read_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1adf69f46749934d660c3721550ea1c03a)` = true` | `bool` |\n| [dynamic_size_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a8ad7c8391ad0b235dfdfd5a6db9732e3)` = false` | `bool` |\n| [element_shape_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a72e5eb3fb8c00fe4a457046e3ebbaabf)` = ::tensorflow::PartialTensorShape()` | `PartialTensorShape` |\n| [identical_element_shapes_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a54f4ec465ff422399336316e2593ecd1)` = false` | `bool` |\n| [tensor_array_name_](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1abf20ffc7391f652ec55c110cc1ef6a62)` = \"\"` | `StringPiece` |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ClearAfterRead](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1afd43b315da52533acfc34c6cf9bb6d0c)`(bool x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs) If true (default), Tensors in the [TensorArray](/versions/r2.1/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are cleared after being read. |\n| [DynamicSize](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a2e7a4d021eec60921c502ca0af09cfd1)`(bool x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs) A boolean that determines whether writes to the [TensorArray](/versions/r2.1/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are allowed to grow the size. |\n| [ElementShape](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1aa6759843dcee15a20ca580b47055468c)`(PartialTensorShape x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs) The expected shape of an element, if known. |\n| [IdenticalElementShapes](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a821ffb1df33eb2716154fe6c0ed03284)`(bool x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs) If true (default is false), then all elements in the [TensorArray](/versions/r2.1/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) will be expected to have have identical shapes. |\n| [TensorArrayName](#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs_1a8ba097c423bc48c48ee1d8ac417dd021)`(StringPiece x)` | `TF_MUST_USE_RESULT `[Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/tensor-array/attrs#structtensorflow_1_1ops_1_1_tensor_array_1_1_attrs) Overrides the name used for the temporary tensor_array resource. |\n\nPublic attributes\n-----------------\n\n### clear_after_read_\n\n```scdoc\nbool tensorflow::ops::TensorArray::Attrs::clear_after_read_ = true\n``` \n\n### dynamic_size_\n\n```scdoc\nbool tensorflow::ops::TensorArray::Attrs::dynamic_size_ = false\n``` \n\n### element_shape_\n\n```scdoc\nPartialTensorShape tensorflow::ops::TensorArray::Attrs::element_shape_ = ::tensorflow::PartialTensorShape()\n``` \n\n### identical_element_shapes_\n\n```scdoc\nbool tensorflow::ops::TensorArray::Attrs::identical_element_shapes_ = false\n``` \n\n### tensor_array_name_\n\n```scdoc\nStringPiece tensorflow::ops::TensorArray::Attrs::tensor_array_name_ = \"\"\n``` \n\nPublic functions\n----------------\n\n### ClearAfterRead\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::ClearAfterRead(\n bool x\n)\n``` \nIf true (default), Tensors in the [TensorArray](/versions/r2.1/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are cleared after being read.\n\nThis disables multiple read semantics but allows early release of memory.\n\nDefaults to true \n\n### DynamicSize\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::DynamicSize(\n bool x\n)\n``` \nA boolean that determines whether writes to the [TensorArray](/versions/r2.1/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) are allowed to grow the size.\n\nBy default, this is not allowed.\n\nDefaults to false \n\n### ElementShape\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::ElementShape(\n PartialTensorShape x\n)\n``` \nThe expected shape of an element, if known.\n\nUsed to validate the shapes of [TensorArray](/versions/r2.1/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) elements. If this shape is not fully specified, gathering zero-size TensorArrays is an error.\n\nDefaults to \n\n### IdenticalElementShapes\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::IdenticalElementShapes(\n bool x\n)\n``` \nIf true (default is false), then all elements in the [TensorArray](/versions/r2.1/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array) will be expected to have have identical shapes.\n\nThis allows certain behaviors, like dynamically checking for consistent shapes on write, and being able to fill in properly shaped zero tensors on stack even if the element_shape attribute is not fully defined.\n\nDefaults to false \n\n### TensorArrayName\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::TensorArray::Attrs::TensorArrayName(\n StringPiece x\n)\n``` \nOverrides the name used for the temporary tensor_array resource.\n\nDefault value is the name of the '[TensorArray](/versions/r2.1/api_docs/cc/class/tensorflow/ops/tensor-array#classtensorflow_1_1ops_1_1_tensor_array)' op (which is guaranteed unique).\n\nDefaults to \"\""]]