MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / empty_cuda

Function empty_cuda

paddle/phi/api/include/compat/ATen/cuda/EmptyTensor.cpp:22–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20namespace at::detail {
21
22at::Tensor empty_cuda(IntArrayRef size,
23 ScalarType dtype,
24 std::optional<Device> device_opt,
25 std::optional<c10::MemoryFormat> memory_format_opt) {
26 PD_CHECK(!(memory_format_opt.has_value() &&
27 memory_format_opt.value() != c10::MemoryFormat::Contiguous),
28 "`MemoryFormat` other than Contiguous is not supported now.");
29 return paddle::experimental::empty(
30 size._PD_ToPaddleIntArray(),
31 compat::_PD_AtenScalarTypeToPhiDataType(dtype),
32 device_opt && device_opt->has_index() ? phi::GPUPlace(device_opt->index())
33 : paddle::DefaultGPUPlace());
34}
35
36at::Tensor empty_cuda(IntArrayRef size, const TensorOptions &options) {
37 auto place = options.has_device() && options.device().has_index()

Callers 2

TESTFunction · 0.85
TESTFunction · 0.85

Calls 9

GPUPlaceClass · 0.85
DefaultGPUPlaceFunction · 0.85
_PD_ToPaddleIntArrayMethod · 0.80
emptyFunction · 0.50
has_valueMethod · 0.45
valueMethod · 0.45
indexMethod · 0.45
deviceMethod · 0.45

Tested by 2

TESTFunction · 0.68
TESTFunction · 0.68