copapy.diagonal# copapy.diagonal(vec)# Create a diagonal tensor from a 1D tensor. Parameters: vec (tensor[Any] | vector[Any]) – A 1D tensor with values to place on the diagonal. Return type: tensor[Any] Returns: A 2D tensor with the input values on the diagonal and zeros elsewhere.