torch.diag would return a 1D tensor with the diagonal elements of your input, since you are passing a 2D input tensor to this method.
If you would like to create a 2D diagonal matrix, your input tensor should be a 1D tensor.
That being said, note that torch.FloatTensor will use uninitialized memory, so you would need to initialize the tensor beforehand.