Then how about shape
if we are just trying to copy the structure?
rand!(shape(M))
… that actually makes linguistic sense. i.e. You could understand that without prior Julia knowledge, whereas both like
and similar
are both misleading.
i.e. rand!(like(M))
may make sense, but like(M)
on its own doesn’t make sense. Because the thing it returns isn’t like M
, it is the shape of M
.