xref: /aosp_15_r20/external/pytorch/aten/src/ATen/native/utils/Factory.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <ATen/core/Tensor.h>
4 
5 namespace at {
6 namespace native {
7 namespace mobile {
8 
9 Tensor allocate_padded_contiguous_if_needed(
10     const Tensor& input,
11     c10::MemoryFormat memory_format);
12 
13 // TODO: Remove this function when at::native::empty() is modified to accept a
14 // custom memory allocator.
15 
16 at::Tensor empty_with_tail_padding(
17     IntArrayRef size,
18     const caffe2::TypeMeta dtype,
19     c10::MemoryFormat memory_format,
20     std::optional<DimnameList> maybe_names);
21 
22 } // namespace mobile
23 } // namespace native
24 } // namespace at
25