เทนเซอร์โฟลว์::ออปส์::แกเธอร์วี2

#include <array_ops.h>

รวบรวม ส่วนต่างๆ จาก axis params ตาม indices

สรุป

indices ต้องเป็นเทนเซอร์จำนวนเต็มที่มีมิติใดก็ได้ (โดยปกติจะเป็น 0 มิติหรือ 1 มิติ) ฟังก์ชันนี้จะสร้างเทนเซอร์เอาต์พุตที่มีรูปร่างเป็น 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

ข้อโต้แย้ง:

  • ขอบเขต: วัตถุ ขอบเขต
  • พารามิเตอร์: เทนเซอร์ที่จะใช้รวบรวมค่า ต้องมีอันดับอย่างน้อยเท่ากับ 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)

โครงสร้าง

tensorflow::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 

ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต

 operator::tensorflow::Input() const 

ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต

 operator::tensorflow::Output() const 

ฟังก์ชันคงที่สาธารณะ

แบตช์ดิมส์

Attrs BatchDims(
  int64 x
)