You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often have a need to perform some transformation on a shape (or a pair of shapes) (implicitly when doing transformations on an ndarray which affects its shape) - and when we have the ability to have both static and dynamic ones I usually have to duplicate the logic. Some motivating examples:
merge two shapes (example an add operation): verify that the two shapes are the same (mathematically) and produce a new one which maximizes compile time information from both input shapes (e.g. one can have a fixed 2nd axis while the other a fixed 3rd axis so the result should have two fixed axes)
concatenation of two shapes across an axis - you have to perform the addition in ct and rt space (and again maximize ct information)
reshaping with a placeholder/free axis (this is an operation in itself that you could add to the library)
what convolutions (in ml space) do with their inputs - for in[N, H, W, C] - the N gets forwarded while H and W get forwarded if padding is on, otherwise they are slightly reduced and input C is fully replaced with a different value
etc....
So provide a generic way (which compiles today ;P) to specify and perform these operations w/o duplication ;D
The text was updated successfully, but these errors were encountered:
Note while I'm looking at that:
the static size can be specififed via kwk::fixed<N> and this typ esupports static-compatible +-*/ so fixed+fixed is still a fixed.
When used as parameters to of_size, it will do the correct thing.
So:
autoadd_shape(auto s1, auto s2)
{
returnof_size( kumi::map( [](auto a, auto b) { return a+b; }, s1, s2);
}
I often have a need to perform some transformation on a shape (or a pair of shapes) (implicitly when doing transformations on an ndarray which affects its shape) - and when we have the ability to have both static and dynamic ones I usually have to duplicate the logic. Some motivating examples:
etc....
So provide a generic way (which compiles today ;P) to specify and perform these operations w/o duplication ;D
The text was updated successfully, but these errors were encountered: