torch.Tensor.Tensor.diagflat
Tensor.diagflat(options?: DiagflatOptions): Tensor<DynamicShape, D, Dev>Tensor.diagflat(offset: number, options?: DiagflatOptions): Tensor<DynamicShape, D, Dev>Creates a 2D tensor with the flattened input as diagonal.
Parameters
optionsDiagflatOptionsoptional
Returns
Tensor<DynamicShape, D, Dev>– 2D tensor with input on diagonal