tensorflow:: אופס:: דיאג

#include <array_ops.h>

מחזירה טנזור אלכסוני עם ערכי אלכסון נתונים.

סיכום

בהינתן diagonal , פעולה זו מחזירה טנזור עם diagonal וכל השאר מרופד באפסים. האלכסון מחושב באופן הבא:

נניח diagonal יש מידות [D1,..., Dk], אז הפלט הוא טנזור בדרגה 2k עם מידות [D1,..., Dk, D1,..., Dk] כאשר:

output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik] ו-0 בכל מקום אחר.

לדוגמה:

# 'diagonal' is [1, 2, 3, 4]
tf.diag(diagonal) ==> [[1, 0, 0, 0]
                       [0, 2, 0, 0]
                       [0, 0, 3, 0]
                       [0, 0, 0, 4]]

טיעונים:

  • scope: אובייקט Scope
  • אלכסון: דירוג k tensor כאשר k הוא לכל היותר 1.

החזרות:

  • Output : טנסור הפלט.

בנאים והורסים

Diag (const :: tensorflow::Scope & scope, :: tensorflow::Input diagonal)

תכונות ציבוריות

operation
output

תפקידים ציבוריים

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

תכונות ציבוריות

מבצע

Operation operation

תְפוּקָה

::tensorflow::Output output

תפקידים ציבוריים

דיאג

 Diag(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input diagonal
)

צוֹמֶת

::tensorflow::Node * node() const 

מפעיל::tensorflow::קלט

 operator::tensorflow::Input() const 

אופרטור::tensorflow::פלט

 operator::tensorflow::Output() const