I just find
Tensor empty(
IntArrayRef size,
c10::optional<DimnameList> names,
c10::optional<ScalarType> dtype,
c10::optional<Layout> layout,
c10::optional<Device> device,
c10::optional<bool> pin_memory,
optional<MemoryFormat> optional_memory_format) {
// See [Note: hacky wrapper removal for TensorOptions]
TensorOptions options = TensorOptions().dtype(dtype).layout(layout).device(device).pinned_memory(pin_memory);
if (!names.has_value()) {
return at::empty(size, options, optional_memory_format);
}
TORCH_CHECK(options.layout() == Layout::Strided,
"NYI: named tensors only support strided layout");
TORCH_CHECK(options.device().is_cpu() || options.device().is_cuda(),
"NYI: named tensors only support CPU and CUDA tensors");
auto result = at::empty(size, options, optional_memory_format);
internal_set_names_inplace(result, names);
return result;
}
but then there is nothing about at::empty(size, options, optional_memory_format);