Can we just change the type of dims to avoid the need to cast it? If not, this is fine.