เทนเซอร์โฟลว์:: ปฏิบัติการ:: รวบรวมV2
#include <array_ops.h> รวบรวม ชิ้นจาก axis แกน params ตาม indices
สรุป
indices จะต้องเป็นเมตริกซ์จำนวนเต็มของมิติใดๆ (โดยปกติจะเป็น 0-D หรือ 1-D) สร้างเอาท์พุตเทนเซอร์ด้วยรูปร่าง params.shape[:axis] + indices.shape + params.shape[axis + 1:] โดยที่:
# Scalar indices (output is rank(params) - 1).
output[a_0, ..., a_n, b_0, ..., b_n] =
params[a_0, ..., a_n, indices, b_0, ..., b_n]# Vector indices (output is rank(params)). output[a_0, ..., a_n, i, b_0, ..., b_n] = params[a_0, ..., a_n, indices[i], b_0, ..., b_n]
# Higher rank indices (output is rank(params) + rank(indices) - 1).
output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] =
params[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n]
โปรดทราบว่าบน CPU หากพบดัชนีนอกขอบเขต ข้อผิดพลาดจะถูกส่งกลับ บน GPU หากพบดัชนีนอกขอบเขต 0 จะถูกเก็บไว้ในค่าเอาต์พุตที่สอดคล้องกัน
ดูเพิ่มเติม tf.batch_gather และ tf.gather_nd
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- params: เทนเซอร์ที่ใช้รวบรวมค่าต่างๆ ต้องมี
axis + 1 - ดัชนี: ดัชนีเทนเซอร์ ต้องอยู่ในช่วง
[0, params.shape[axis]) - แกน: แกนใน
paramsที่จะรวบรวมindicesค่าเริ่มต้นเป็นมิติแรก รองรับดัชนีเชิงลบ
ผลตอบแทน:
-
Output: ค่าจากparamsที่รวบรวมจากดัชนีที่กำหนดโดยindicesโดยมีรูปร่างparams.shape[:axis] + indices.shape + params.shape[axis + 1:]
ตัวสร้างและผู้ทำลาย | |
|---|---|
GatherV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input params, :: tensorflow::Input indices, :: tensorflow::Input axis) | |
GatherV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input params, :: tensorflow::Input indices, :: tensorflow::Input axis, const GatherV2::Attrs & attrs) |
คุณลักษณะสาธารณะ | |
|---|---|
operation | |
output | |
งานสาธารณะ | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
ฟังก์ชันคงที่สาธารณะ | |
|---|---|
BatchDims (int64 x) | |
โครงสร้าง | |
|---|---|
| เทนเซอร์โฟลว์ :: ops :: GatherV2 :: Attrs | ตัวตั้งค่าแอ็ตทริบิวต์ทางเลือกสำหรับ GatherV2 |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
เอาท์พุท
::tensorflow::Output output
งานสาธารณะ
รวบรวมV2
GatherV2( const ::tensorflow::Scope & scope, ::tensorflow::Input params, ::tensorflow::Input indices, ::tensorflow::Input axis )
รวบรวมV2
GatherV2( const ::tensorflow::Scope & scope, ::tensorflow::Input params, ::tensorflow::Input indices, ::tensorflow::Input axis, const GatherV2::Attrs & attrs )
โหนด
::tensorflow::Node * node() const
ตัวดำเนินการ::tensorflow::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::tensorflow::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
BatchDims
Attrs BatchDims( int64 x )