เทนเซอร์โฟลว์::ออปส์::แพด
#include <array_ops.h>เติมค่าศูนย์ลงในเทนเซอร์
สรุป
การดำเนินการนี้จะเติมศูนย์ลง input ตามค่า paddings ที่คุณระบุ paddings เป็นเทนเซอร์จำนวนเต็มที่มีรูปร่าง [Dn, 2] โดยที่ n คืออันดับของ input สำหรับแต่ละมิติ D ของ input paddings[D, 0] จะระบุจำนวนศูนย์ที่จะเพิ่มก่อนเนื้อหาของ input ในมิตินั้น และ paddings[D, 1] จะระบุจำนวนศูนย์ที่จะเพิ่มหลังจากเนื้อหาของ input ในมิตินั้น
ขนาดที่เผื่อไว้ของแต่ละมิติ D ของผลลัพธ์คือ:
paddings(D, 0) + input.dim_size(D) + paddings(D, 1)
ตัวอย่างเช่น:
# 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1], [2, 2]]
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
[0, 0, 1, 1, 0, 0]
[0, 0, 2, 2, 0, 0]
[0, 0, 0, 0, 0, 0]]ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
การส่งคืนสินค้า:
-
Output: เทนเซอร์เอาต์พุต
ตัวสร้างและตัวทำลาย | |
|---|---|
Pad (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input paddings) |
คุณลักษณะสาธารณะ | |
|---|---|
operation | |
output | |
หน้าที่สาธารณะ | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
เอาต์พุต
::tensorflow::Output output
หน้าที่สาธารณะ
แผ่นรอง
Pad( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input paddings )
โหนด
::tensorflow::Node * node() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต
operator::tensorflow::Output() const