Function torch::stable::contiguous#
Defined in File ops.h
Function Documentation#
-
inline torch::stable::Tensor torch::stable::contiguous(const torch::stable::Tensor &self, torch::headeronly::MemoryFormat memory_format = torch::headeronly::MemoryFormat::Contiguous)#
Stable version of the contiguous op.
Returns a contiguous in memory tensor containing the same data as the input tensor. If the input tensor is already contiguous in the specified memory format, the input tensor is returned.
Minimum compatible version: PyTorch 2.10.
- Parameters:
self – The input tensor.
memory_format – The desired memory format.
- Returns:
A contiguous tensor.