Closed timotheecour closed 8 years ago
I am not against it, but need more opinions about this.
I'm in favour of this, because users can always use [myDimsAliasSeq]
to get the array (which won't allocate if it's bound to a static array symbol i.e. in the call to slice). I'm a bit worried about people creating a lot of garbage accidentally when manipulating dimensions though.
I think the 1D case should perhaps stay working without being an array, would seem like unnecessary noise to add [] there.
But all other functions ? Like transposed and iotaSlice
i think yes. Consistency is good here. Also, being able to add extra arguments in the future will help maintain flexibility in the future (very important, particularly once ndslice
is out of std.experimental
)
Ping DCV contributors @ljubobratovicrelja @henrygouk @DmitryOlshansky. What is your opinion about this breaking change?
I personally like the variadic approach, and would not forcibly replace it with static array. Say for the slice!T
, as tensor allocation - most of the time I'd just allocate a tensor, without explicit value initialization - so []
would bother me in syntax mostly. Also, for e.g. I feel having []
in transposed
would be a bit odd, in contrast to the present API.
I think I'm already used to the present API, which mostly works with variadics, and I haven't had any trouble with it - I really cannot tell how I would feel with newly proposed syntax. That's just my subjective view on it.
But, obviously since python (numpy) users feel the inconsistency, I suppose there's a real trouble here. Might be good idea to ping some more people, or even have the forum thread about it? (or maybe not the forum thread since we've seen how the simplest debate can burst into flames there...)
Hmm I think actually there's a distinction between arguments that are shapes (e.g. argument to sliced
) and arguments that are dimension indices (e.g. arguments to transposed). I think static arrays are better for shapes. I'm undecided on dimension indices but would err on the side of using veridical, if only to make the distinction clear.
Forum voting/discussion http://forum.dlang.org/thread/lxsuvoxqjiecjenrfvtj@forum.dlang.org
According to the forum discussion (appr. equal Yes/No and small activity) I close this issue with wontfix.
I'd like mir to consistently accept input shape argument as a static array, never as separate indexes, kind of like numpy:
Currently in mir this all works:
Several reasons for changing this:
auto a7
above