LCOV - code coverage report
Current view: top level - home/runner/.local/lib/python3.9/site-packages/torch/include/ATen/ops - ones.h (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 2 2 100.0 %
Date: 2025-12-04 11:19:34 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #pragma once
       2             : 
       3             : // @generated by torchgen/gen.py from Function.h
       4             : 
       5             : #include <ATen/Context.h>
       6             : #include <ATen/DeviceGuard.h>
       7             : #include <ATen/TensorUtils.h>
       8             : #include <ATen/TracerMode.h>
       9             : #include <ATen/core/Generator.h>
      10             : #include <ATen/core/Reduction.h>
      11             : #include <ATen/core/Tensor.h>
      12             : #include <c10/core/Scalar.h>
      13             : #include <c10/core/Storage.h>
      14             : #include <c10/core/TensorOptions.h>
      15             : #include <c10/util/Deprecated.h>
      16             : #include <optional>
      17             : #include <string_view>
      18             : 
      19             : 
      20             : 
      21             : #include <ATen/ops/ones_ops.h>
      22             : 
      23             : namespace at {
      24             : 
      25             : 
      26             : // aten::ones.names(int[] size, *, Dimname[]? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      27             : inline at::Tensor ones(at::IntArrayRef size, ::std::optional<at::DimnameList> names, at::TensorOptions options={}) {
      28             :     return at::_ops::ones_names::call(size, names, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
      29             : }
      30             : // aten::ones.names(int[] size, *, Dimname[]? names, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      31             : inline at::Tensor ones(at::IntArrayRef size, ::std::optional<at::DimnameList> names, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory) {
      32             :     return at::_ops::ones_names::call(size, names, dtype, layout, device, pin_memory);
      33             : }
      34             : 
      35             : // aten::ones(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      36          55 : inline at::Tensor ones(at::IntArrayRef size, at::TensorOptions options={}) {
      37          55 :     return at::_ops::ones::call(c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
      38             : }
      39             : namespace symint {
      40             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
      41             :   at::Tensor ones(at::IntArrayRef size, at::TensorOptions options={}) {
      42             :     return at::_ops::ones::call(c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
      43             :   }
      44             : }
      45             : 
      46             : // aten::ones(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      47             : inline at::Tensor ones(at::IntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory) {
      48             :     return at::_ops::ones::call(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory);
      49             : }
      50             : namespace symint {
      51             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
      52             :   at::Tensor ones(at::IntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory) {
      53             :     return at::_ops::ones::call(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory);
      54             :   }
      55             : }
      56             : 
      57             : // aten::ones(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      58             : inline at::Tensor ones_symint(c10::SymIntArrayRef size, at::TensorOptions options={}) {
      59             :     return at::_ops::ones::call(size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
      60             : }
      61             : namespace symint {
      62             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
      63             :   at::Tensor ones(c10::SymIntArrayRef size, at::TensorOptions options={}) {
      64             :     return at::_ops::ones::call(size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
      65             :   }
      66             : }
      67             : 
      68             : // aten::ones(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      69             : inline at::Tensor ones_symint(c10::SymIntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory) {
      70             :     return at::_ops::ones::call(size, dtype, layout, device, pin_memory);
      71             : }
      72             : namespace symint {
      73             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
      74             :   at::Tensor ones(c10::SymIntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory) {
      75             :     return at::_ops::ones::call(size, dtype, layout, device, pin_memory);
      76             :   }
      77             : }
      78             : 
      79             : // aten::ones.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
      80             : inline at::Tensor & ones_out(at::Tensor & out, at::IntArrayRef size) {
      81             :     return at::_ops::ones_out::call(c10::fromIntArrayRefSlow(size), out);
      82             : }
      83             : namespace symint {
      84             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
      85             :   at::Tensor & ones_out(at::Tensor & out, at::IntArrayRef size) {
      86             :     return at::_ops::ones_out::call(c10::fromIntArrayRefSlow(size), out);
      87             :   }
      88             : }
      89             : 
      90             : // aten::ones.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
      91             : inline at::Tensor & ones_outf(at::IntArrayRef size, at::Tensor & out) {
      92             :     return at::_ops::ones_out::call(c10::fromIntArrayRefSlow(size), out);
      93             : }
      94             : namespace symint {
      95             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
      96             :   at::Tensor & ones_outf(at::IntArrayRef size, at::Tensor & out) {
      97             :     return at::_ops::ones_out::call(c10::fromIntArrayRefSlow(size), out);
      98             :   }
      99             : }
     100             : 
     101             : // aten::ones.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
     102             : inline at::Tensor & ones_symint_out(at::Tensor & out, c10::SymIntArrayRef size) {
     103             :     return at::_ops::ones_out::call(size, out);
     104             : }
     105             : namespace symint {
     106             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
     107             :   at::Tensor & ones_out(at::Tensor & out, c10::SymIntArrayRef size) {
     108             :     return at::_ops::ones_out::call(size, out);
     109             :   }
     110             : }
     111             : 
     112             : // aten::ones.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
     113             : inline at::Tensor & ones_symint_outf(c10::SymIntArrayRef size, at::Tensor & out) {
     114             :     return at::_ops::ones_out::call(size, out);
     115             : }
     116             : namespace symint {
     117             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
     118             :   at::Tensor & ones_outf(c10::SymIntArrayRef size, at::Tensor & out) {
     119             :     return at::_ops::ones_out::call(size, out);
     120             :   }
     121             : }
     122             : 
     123             : // aten::ones.names_out(int[] size, *, Dimname[]? names, Tensor(a!) out) -> Tensor(a!)
     124             : inline at::Tensor & ones_out(at::Tensor & out, at::IntArrayRef size, ::std::optional<at::DimnameList> names) {
     125             :     return at::_ops::ones_names_out::call(size, names, out);
     126             : }
     127             : // aten::ones.names_out(int[] size, *, Dimname[]? names, Tensor(a!) out) -> Tensor(a!)
     128             : inline at::Tensor & ones_outf(at::IntArrayRef size, ::std::optional<at::DimnameList> names, at::Tensor & out) {
     129             :     return at::_ops::ones_names_out::call(size, names, out);
     130             : }
     131             : 
     132             : }

Generated by: LCOV version 1.16