flâneur — a map of the web's best reading

torch.empty — PyTorch 2.12 documentation

docs.pytorch.org · 313 words · saved by 1 readers

Returns a tensor filled with uninitialized data. The shape of the tensor is defined by the variable argument size. Note If torch.use_deterministic_algorithms() and torch.utils.deterministic.fill_uninitialized_memory are both set to True, the output tensor is initialized to prevent any possible nondeterministic behavior from using the data as an input to an operation. Floating point and complex tensors are filled with NaN, and integer tensors are filled with the maximum value. size (int...) – a sequence of integers defining the shape of the output tensor. Can be a variable number of arguments or a collection like a list or tuple. out (Tensor, optional) – the output tensor. dtype (torch.dtype, optional) – the desired data type of returned tensor. Default: if None, uses a global default (see torch.set_default_dtype()). layout (torch.layout, optional) – the desired layout of returned Tensor. Default: torch.strided. device (torch.device, optional) – the desired device of returned tensor. De

torch.empty # torch. empty ( *size , * , out=None , dtype=None , layout=torch.strided , device=None , requires_grad=False , pin_memory=False , memory_format=torch.contiguous_format ) → Tensor # Returns a tensor filled with uninitialized data. The shape of the tensor is defined by the variable argument size . Note If torch.use_deterministic_algorithms() and torch.utils.deterministic.fill_uninitialized_memory are both set to True , the output tensor is initialized to prevent any possible nondeterministic behavior from using the data as an input to an operation. Floating point and complex

Explore this link on the map →

related reading