LCOV - code coverage report
Current view: top level - home/runner/.local/lib/python3.11/site-packages/torch/include/ATen/ops - zeros.h (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 2 2 100.0 %
Date: 2026-11-05 10:19:04 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(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      28          95 : inline at::Tensor zeros(at::IntArrayRef size, at::TensorOptions options={}) {
      29          95 :     return at::_ops::zeros::call(c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
      30             : }
      31             : namespace symint {
      32             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
      33             :   at::Tensor zeros(at::IntArrayRef size, at::TensorOptions options={}) {
      34             :     return at::_ops::zeros::call(c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
      35             :   }
      36             : }
      37             : 
      38             : // aten::zeros(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      39             : 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) {
      40             :     return at::_ops::zeros::call(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory);
      41             : }
      42             : namespace symint {
      43             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
      44             :   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) {
      45             :     return at::_ops::zeros::call(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory);
      46             :   }
      47             : }
      48             : 
      49             : // aten::zeros(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      50             : inline at::Tensor zeros_symint(c10::SymIntArrayRef size, at::TensorOptions options={}) {
      51             :     return at::_ops::zeros::call(size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
      52             : }
      53             : namespace symint {
      54             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
      55             :   at::Tensor zeros(c10::SymIntArrayRef size, at::TensorOptions options={}) {
      56             :     return at::_ops::zeros::call(size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
      57             :   }
      58             : }
      59             : 
      60             : // aten::zeros(SymInt[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
      61             : 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) {
      62             :     return at::_ops::zeros::call(size, dtype, layout, device, pin_memory);
      63             : }
      64             : namespace symint {
      65             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
      66             :   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) {
      67             :     return at::_ops::zeros::call(size, dtype, layout, device, pin_memory);
      68             :   }
      69             : }
      70             : 
      71             : // aten::zeros.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
      72             : inline at::Tensor & zeros_out(at::Tensor & out, at::IntArrayRef size) {
      73             :     return at::_ops::zeros_out::call(c10::fromIntArrayRefSlow(size), out);
      74             : }
      75             : namespace symint {
      76             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
      77             :   at::Tensor & zeros_out(at::Tensor & out, at::IntArrayRef size) {
      78             :     return at::_ops::zeros_out::call(c10::fromIntArrayRefSlow(size), out);
      79             :   }
      80             : }
      81             : 
      82             : // aten::zeros.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
      83             : inline at::Tensor & zeros_outf(at::IntArrayRef size, at::Tensor & out) {
      84             :     return at::_ops::zeros_out::call(c10::fromIntArrayRefSlow(size), out);
      85             : }
      86             : namespace symint {
      87             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, int64_t>>>
      88             :   at::Tensor & zeros_outf(at::IntArrayRef size, at::Tensor & out) {
      89             :     return at::_ops::zeros_out::call(c10::fromIntArrayRefSlow(size), out);
      90             :   }
      91             : }
      92             : 
      93             : // aten::zeros.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
      94             : inline at::Tensor & zeros_symint_out(at::Tensor & out, c10::SymIntArrayRef size) {
      95             :     return at::_ops::zeros_out::call(size, out);
      96             : }
      97             : namespace symint {
      98             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
      99             :   at::Tensor & zeros_out(at::Tensor & out, c10::SymIntArrayRef size) {
     100             :     return at::_ops::zeros_out::call(size, out);
     101             :   }
     102             : }
     103             : 
     104             : // aten::zeros.out(SymInt[] size, *, Tensor(a!) out) -> Tensor(a!)
     105             : inline at::Tensor & zeros_symint_outf(c10::SymIntArrayRef size, at::Tensor & out) {
     106             :     return at::_ops::zeros_out::call(size, out);
     107             : }
     108             : namespace symint {
     109             :   template <typename T, typename = std::enable_if_t<std::is_same_v<T, c10::SymInt>>>
     110             :   at::Tensor & zeros_outf(c10::SymIntArrayRef size, at::Tensor & out) {
     111             :     return at::_ops::zeros_out::call(size, out);
     112             :   }
     113             : }
     114             : 
     115             : }
     116             : 
     117             : #else
     118             : #error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined."
     119             : #endif  // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)

Generated by: LCOV version 1.16