Just checking stride[numDim-1] or stride[numDim-2] == 1 is not enough.
If a matrix has M x K shape, CUBLAS_OP_T (row-major) will have stride [..., >=K, 1], CUBLAS_OP_N (col-major) will have stride [..., 1, >=M].
If M or K is 1, just checking either of stride is 1 breaks down.
When M == K == 1, one can think there's an ambiguity but that's moot because for 1x1 matrix transpose is nop.
Just checking stride[numDim-1] or stride[numDim-2] == 1 is not enough. If a matrix has M x K shape, CUBLAS_OP_T (row-major) will have stride [..., >=K, 1], CUBLAS_OP_N (col-major) will have stride [..., 1, >=M]. If M or K is 1, just checking either of stride is 1 breaks down. When M == K == 1, one can think there's an ambiguity but that's moot because for 1x1 matrix transpose is nop.