LCOV - code coverage report
Current view: top level - home/runner/.local/lib/python3.10/site-packages/torch/include/ATen/ops - zeros.h (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 2 2 100.0 %
Date: 2026-06-05 17:04:24 Functions: 1 1 100.0 %

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

Generated by: LCOV version 1.16