Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
tensor akışı:: işlem:: MatrixSetDiag
#include <array_ops.h>
Yeni toplu çapraz değerlere sahip toplu matris tensörünü döndürür.
Özet
input
ve diagonal
verildiğinde, bu işlem, en içteki matrislerin ana köşegeni dışında, input
ile aynı şekil ve değerlere sahip bir tensör döndürür. Bunların üzerine diagonal
değerler yazılacaktır.
Çıkış şu şekilde hesaplanır:
input
k+1
boyuta sahip olduğunu [I, J, K, ..., M, N]
ve diagonal
k
boyuta sahip olduğunu [I, J, K, ..., min(M, N)]
varsayın. Bu durumda çıktı [I, J, K, ..., M, N]
boyutlarına sahip k+1
dereceli bir tensördür; burada:
-
output[i, j, k, ..., m, n] = diagonal[i, j, k, ..., n]
m == n
için. -
m != n
için output[i, j, k, ..., m, n] = input[i, j, k, ..., m, n]
.
Argümanlar:
- kapsam: Bir Kapsam nesnesi
- giriş: Sıra
k+1
, burada k >= 1
. - diyagonal: Sıra
k
, burada k >= 1
.
İade:
-
Output
: Rank k+1
, output.shape = input.shape
.
Genel özellikler
Kamu işlevleri
düğüm
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operatör::tensorflow::Çıktı
operator::tensorflow::Output() const
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::MatrixSetDiag Class Reference\n\ntensorflow::ops::MatrixSetDiag\n==============================\n\n`#include \u003carray_ops.h\u003e`\n\nReturns a batched matrix tensor with new batched diagonal values.\n\nSummary\n-------\n\nGiven `input` and `diagonal`, this operation returns a tensor with the same shape and values as `input`, except for the main diagonal of the innermost matrices. These will be overwritten by the values in `diagonal`.\n\nThe output is computed as follows:\n\nAssume `input` has `k+1` dimensions `[I, J, K, ..., M, N]` and `diagonal` has `k` dimensions `[I, J, K, ..., min(M, N)]`. Then the output is a tensor of rank `k+1` with dimensions `[I, J, K, ..., M, N]` where:\n\n\n- `output[i, j, k, ..., m, n] = diagonal[i, j, k, ..., n]` for `m == n`.\n- `output[i, j, k, ..., m, n] = input[i, j, k, ..., m, n]` for `m != n`.\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- input: Rank `k+1`, where `k \u003e= 1`.\n- diagonal: Rank `k`, where `k \u003e= 1`.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): Rank `k+1`, with `output.shape = input.shape`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [MatrixSetDiag](#classtensorflow_1_1ops_1_1_matrix_set_diag_1af9f6deaf5d71f88356239fd1fceb3bd5)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` input, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` diagonal)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_matrix_set_diag_1ac564fb65fed63cd95c5a876d8cfcb004) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_matrix_set_diag_1a58d08deb35db4f1602c1df59432ade6c) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_matrix_set_diag_1a20fc7ca0974220bfcd3a3aee08803d6c)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_matrix_set_diag_1af98eee12ae5e443a923b794be760afd7)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_matrix_set_diag_1adf4b733c12f7c7dc2387318fafff0413)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### MatrixSetDiag\n\n```gdscript\n MatrixSetDiag(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input input,\n ::tensorflow::Input diagonal\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n```"]]