Show / Hide Table of Contents

    Method diagMat

    static member diagMat: Tensor<'T> -> Tensor<'T>

    Creates a matrix with the specified diagonal.

    Declaration
    static member diagMat: a:Tensor<'T> -> Tensor<'T>
    Parameters
    Type Name Description
    Tensor<'T> a

    The vector containing the values for the diagonal.

    Returns
    Type Description
    Tensor<'T>

    A matrix having the values a on its diagonal.

    Remarks

    A square matrix with the same size as a is created.

    The diagonal is filled with the elements of vector a. The other elements are set to zero.

    If the specified tensor has more than one dimension, the operation is performed batch-wise on the last dimension.

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