เทนเซอร์โฟลว์:: ออปส์:: สแต็ก

#include <array_ops.h>

รวมรายการเทนเซอร์ระดับ N จำนวน R ตัว เข้าเป็นเทนเซอร์ระดับ (R+1) ตัวเดียว

สรุป

จัดเรียงเทนเซอร์ N ตัวใน values ลงในเทนเซอร์ที่มีอันดับสูงกว่าแต่ละเทนเซอร์ใน values หนึ่งอันดับ โดยการจัดเรียงตามมิติ axis โดยกำหนดรายการเทนเซอร์ที่มีรูปร่าง (A, B, C) มาให้

ถ้า axis == 0 เทนเซอร์ output จะมีรูปร่าง (N, A, B, C) ถ้า axis == 1 เทนเซอร์ output จะมีรูปร่าง (A, N, B, C) เป็นต้น

ตัวอย่างเช่น:

# 'x' is [1, 4]
# 'y' is [2, 5]
# 'z' is [3, 6]
pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]]  # Pack along first dim.
pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]

นี่คือสิ่งที่ตรงข้ามกับ unpack

ข้อโต้แย้ง:

  • ขอบเขต: วัตถุ ขอบเขต
  • ค่าต่างๆ: ต้องมีรูปร่างและประเภทเดียวกัน

คุณลักษณะเสริม (ดูที่ Attrs ):

  • แกน: มิติที่ใช้ในการบรรจุ ค่าลบจะวนกลับ ดังนั้นช่วงค่าที่ถูกต้องคือ [-(R+1), R+1) .

การส่งคืนสินค้า:

  • Output : เทนเซอร์ที่ถูกบีอัดแล้ว

ตัวสร้างและตัวทำลาย

Stack (const :: tensorflow::Scope & scope, :: tensorflow::InputList values)
Stack (const :: tensorflow::Scope & scope, :: tensorflow::InputList values, const Stack::Attrs & attrs)

คุณลักษณะสาธารณะ

operation
output

หน้าที่สาธารณะ

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

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

Axis (int64 x)

โครงสร้าง

tensorflow:: ops:: Stack:: Attrs

ตัวเลือกในการตั้งค่าแอตทริบิวต์สำหรับ Stack

คุณลักษณะสาธารณะ

การดำเนินการ

Operation operation

เอาต์พุต

::tensorflow::Output output

หน้าที่สาธารณะ

ซ้อนกัน

 Stack(
  const ::tensorflow::Scope & scope,
  ::tensorflow::InputList values
)

ซ้อนกัน

 Stack(
  const ::tensorflow::Scope & scope,
  ::tensorflow::InputList values,
  const Stack::Attrs & attrs
)

โหนด

::tensorflow::Node * node() const 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const 

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

แกน

Attrs Axis(
  int64 x
)