inputSize is quite ambiguous alone because many ML libraries have a Size() operator which (for better or worse, and probably should have been called ElementCount() instead) returns the total number of elements, not the count of dimensions. So, inputRank or inputShapeSize or inputDimensionCount would all be clearer names (with inputRank being the most concise)
So any place where "size" is being used to refer to the number of dimensions, replace with "rank".
inputSize → inputRank
outputSize → outputRank
filterSize → filterRank
sizeA → rankA
sizeB → rankB
... any others?
Note though that while an MLOperand has a rank, if what an algorithm is processing is a list that list has a size not a rank. If the list is a list of dimensions, it's fine to store that in a local variable called rank, though!
Per discussion in https://github.com/webmachinelearning/webnn/pull/582#discussion_r1503644898 @fdwr writes:
So any place where "size" is being used to refer to the number of dimensions, replace with "rank".
Note though that while an MLOperand has a rank, if what an algorithm is processing is a list that list has a size not a rank. If the list is a list of dimensions, it's fine to store that in a local variable called rank, though!