Rate this Page

Function torch::stable::full#

Function Documentation#

inline torch::stable::Tensor torch::stable::full(torch::headeronly::IntHeaderOnlyArrayRef size, double fill_value, std::optional<torch::headeronly::ScalarType> dtype = std::nullopt, std::optional<torch::headeronly::Layout> layout = std::nullopt, std::optional<torch::stable::Device> device = std::nullopt, std::optional<bool> pin_memory = std::nullopt)#

Stable version of the full.default op.

Creates a tensor of the specified size filled with the given value.

Minimum compatible version: PyTorch 2.10.

Note

The fill_value parameter is typed C shim API uses double for the Scalar parameter.

Parameters:
  • size – The desired size of the output tensor.

  • fill_value – The value to fill the tensor with.

  • dtype – Optional scalar type for the tensor elements.

  • layout – Optional memory layout.

  • device – Optional device to place the tensor on.

  • pin_memory – Optional flag to use pinned memory.

Returns:

A new tensor filled with the specified value.