Additionally, there is also a helper macro THFloatTensor_fastGet2d(...) 63, which is roughtly equivalent to the function sent by @Frank_Lee but has no boundary checks, so it can be optimized out during compilation