Rate this Page

torch.Tensor.resize_as_#

Tensor.resize_as_(tensor,memory_format=torch.contiguous_format)Tensor#

Resizes theself 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 ofTensor. Default:torch.contiguous_format. Note that memory format ofself is going to be unaffected ifself.size() matchestensor.size().