Show / Hide Table of Contents

    Method diagMatAxis

    static member diagMatAxis: int -> int -> Tensor<'T> -> Tensor<'T>

    Creates a tensor with the specified diagonal along the given axes.

    Declaration
    static member diagMatAxis: ax1:int -> ax2:int -> a:Tensor<'T> -> Tensor<'T>
    Parameters
    Type Name Description
    int ax1

    The first dimension of the diagonal.

    int ax2

    The seconds dimension of the diagonal.

    Tensor<'T> a

    The values for the diagonal.

    Returns
    Type Description
    Tensor<'T>

    A tensor having the values a on the diagonal specified by the axes ax1 and ax2.

    Remarks

    A new tensor with the same shape as a but with axis ax2 inserted is created. The size of axis ax2 is set to the size of axis ax1.

    The diagonal over axes ax1 and ax2 is filled with the elements of tensor a. The other elements are set to zero.

    Examples
     let a = HostTensor.zeros [4L; 3L]
     let b = Tensor.diagMatAxis 0 1 a // b.Shape = [4L; 4L; 3L]
    See Also
    static member diagMat: Tensor<'T> -> Tensor<'T>
    static member diagAxis: int -> int -> Tensor<'T> -> Tensor<'T>
    Back to top Generated by DocFX