treemax support for non-contiguous tensors