• Create an identity matrix.

    Parameters

    • numRows: number

      Number of rows.

    • Optional numColumns: number

      Number of columns. Defaults to numRows.

    • Optional batchShape: [number] | [number, number] | [number, number, number] | [number, number, number, number]

      If provided, will add the batch shape to the beginning of the shape of the returned tf.Tensor by repeating the identity matrix.

    • Optional dtype: keyof DataTypeMap

      Data type.

    Returns Tensor2D

    Identity matrix of the specified size and data type, possibly with batch repetition if batchShape is specified.

    Doc

Generated using TypeDoc