aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.batch_matrix_diag.md
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.batch_matrix_diag.md')
-rw-r--r--tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.batch_matrix_diag.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.batch_matrix_diag.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.batch_matrix_diag.md
new file mode 100644
index 0000000000..6e5458ba6c
--- /dev/null
+++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard9/tf.batch_matrix_diag.md
@@ -0,0 +1,42 @@
+### `tf.batch_matrix_diag(diagonal, name=None)` {#batch_matrix_diag}
+
+Returns a batched diagonal tensor with a given batched diagonal values.
+
+Given a `diagonal`, this operation returns a tensor with the `diagonal` and
+everything else padded with zeros. The diagonal is computed as follows:
+
+Assume `diagonal` has `k` dimensions `[I, J, K, ..., N]`, then the output is a
+tensor of rank `k+1` with dimensions [I, J, K, ..., N, N]` where:
+
+`output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]`.
+
+For example:
+
+```prettyprint
+# 'diagonal' is [[1, 2, 3, 4], [5, 6, 7, 8]]
+
+and diagonal.shape = (2, 4)
+
+tf.batch_matrix_diag(diagonal) ==> [[[1, 0, 0, 0]
+ [0, 2, 0, 0]
+ [0, 0, 3, 0]
+ [0, 0, 0, 4]],
+ [[5, 0, 0, 0]
+ [0, 6, 0, 0]
+ [0, 0, 7, 0]
+ [0, 0, 0, 8]]]
+
+which has shape (2, 4, 4)
+```
+
+##### Args:
+
+
+* <b>`diagonal`</b>: A `Tensor`. Rank `k`, where `k >= 1`.
+* <b>`name`</b>: A name for the operation (optional).
+
+##### Returns:
+
+ A `Tensor`. Has the same type as `diagonal`.
+ Rank `k+1`, with `output.shape = diagonal.shape + [diagonal.shape[-1]]`.
+