This warning can be raised, if the TensorIterator detects a channels_last tensor and another one in the contiguous memory format.
I guess k.transpose(1, 2).bmm(q) might be raising it.
Could you print the .size() and .stride() of both involved tensors?