great - if you look at this, there are a few things I didn’t post; float64 or float16 torch data, but it varies wildly.  I dont have a good setup to deal with double or half floats so the comparison isnt valid.
I found some funny numbers to do with contiguity which I also didn’t post, because first it worked one way then another. But it went something like this,
tensor.permute(2,1,0).contiguous()
# vs
w,h,c = tensor.shape
out =  torch.zeros([1,c,h,w]])
out[0] = tensor.permute(2,1,0)
# both return a contiguous tensor

in some instances i got the latter to be 2x the speed of the ‘proper way’
although, maybe this is meaningless. Because the test wasn’t consistent.
At any rate if one is serious about the speed one should probably be working in cpp. Which I thought, maybe the way to get rid of all this uncertainty is load from buffer to a torch tensor of shape dtype device that is contiguous, directly in cpp… But thats another day.