▲ | tomsmeding 8 days ago | |
Rank polymorphism means that a function can be polymorphic in the additional dimensions of arrays. For example, if you write a function that takes a 2x3 and a 4x5 array, it can also work on 10x15x2x3 and 10x15x4x5 arrays by broadcasting. If rank polymorphism results in accepting both 4x2x8 and 3x7, then that means the function was a function on elements to begin with. Which is possible, but not the most interesting application of rank polymorphism. | ||
▲ | djoldman 8 days ago | parent [-] | |
> Rank polymorphism means that a function can be polymorphic in the additional dimensions of arrays. For example, if you write a function that takes a 2x3 and a 4x5 array, it can also work on 10x15x2x3 and 10x15x4x5 arrays by broadcasting. Thanks, this is what I was ineloquently attempting to describe with "A function that can take as input a 4x2x8 matrix or a 3x7 matrix." |