Allocating pointers to array instead of tensors