torch.Tensor.resize_as_¶
-
Tensor.
resize_as_
(tensor, memory_format=torch.contiguous_format) → Tensor¶ Resizes the
self
tensor to be the same size as the specifiedtensor
. This is equivalent toself.resize_(tensor.size())
.- Parameters
memory_format (
torch.memory_format
, optional) – the desired memory format of Tensor. Default:torch.contiguous_format
. Note that memory format ofself
is going to be unaffected ifself.size()
matchestensor.size()
.