tensorflow::ops::SetDiff1D
#include <array_ops.h>คำนวณหาผลต่างระหว่างรายการตัวเลขหรือสตริงสองรายการ
สรุป
เมื่อกำหนดลิสต์ x และลิสต์ y แล้ว การดำเนินการนี้จะส่งคืนลิสต์ out ซึ่งแสดงค่าทั้งหมดที่อยู่ใน x แต่ไม่อยู่ใน y ลิสต์ out ที่ส่งคืนจะเรียงลำดับตามลำดับที่ตัวเลขปรากฏใน x (ค่าซ้ำจะยังคงอยู่) การดำเนินการนี้ยังส่งคืนลิสต์ idx ซึ่งแสดงตำแหน่งของแต่ละองค์ประกอบในลิสต์ out ใน x กล่าวอีกนัยหนึ่งคือ:
out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]
ตัวอย่างเช่น เมื่อป้อนข้อมูลต่อไปนี้:
x = [1, 2, 3, 4, 5, 6] y = [1, 3, 5]
การดำเนินการนี้จะส่งคืน:
out ==> [2, 4, 6] idx ==> [1, 3, 5]
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- x: 1 มิติ ค่าที่ควรเก็บรักษา
- y: 1 มิติ ค่าที่จะลบออก
การส่งคืนสินค้า:
-
Output: 1 มิติ ค่าที่มีอยู่ในxแต่ไม่อยู่ในy -
Outputidx: 1 มิติ ตำแหน่งของค่าxจะถูกเก็บรักษาไว้ในout
ตัวสร้างและตัวทำลาย | |
|---|---|
SetDiff1D (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input y) | |
SetDiff1D (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input y, const SetDiff1D::Attrs & attrs) |
คุณลักษณะสาธารณะ | |
|---|---|
idx | |
operation | |
out | |
ฟังก์ชันคงที่สาธารณะ | |
|---|---|
OutIdx (DataType x) | |
โครงสร้าง | |
|---|---|
| tensorflow::ops::SetDiff1D::Attrs | ตัวเลือกในการตั้งค่าแอตทริบิวต์สำหรับ SetDiff1D |
คุณลักษณะสาธารณะ
idx
::tensorflow::Output idx
การดำเนินการ
Operation operation
ออก
::tensorflow::Output out
หน้าที่สาธารณะ
เซ็ตดิฟ1D
SetDiff1D( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y )
เซ็ตดิฟ1D
SetDiff1D( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y, const SetDiff1D::Attrs & attrs )
ฟังก์ชันคงที่สาธารณะ
เอาท์ไอดซ์
Attrs OutIdx( DataType x )