Skip to contents

Convert scalar input to square matrix of dimension output_size x output_size with input along the diagonal, or check that input array is equivalent to a square matrix of dimension output_size x output_size.

Usage

expand_dims_2d_diag(input, output_size)

Arguments

input

Input to be converted to a square matrix (or passed through as-is)

output_size

Intended row and column dimension of the square output matrix

Value

A square matrix of dimension output_size x output_size