image.transpose with more than 2 dims is a numpy method and thus not usable in libtorch.
You would have to either transpose two dimensions (using the same syntax as in Python) or use permute instead (tensor.oermute({2, 0, 1})).
torch.from_numpy is not available in libtorch, if I’m not mistaken.