// required for old g++ to compile PRId64 macros, see
// https://github.com/pytorch/pytorch/issues/3571
// for context
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif

// an external backend might generate file within its code tree
// and check all the source files within the tree with clang-format.
// so, disable it since the backend might have a different config.
// clang-format off

// NOTE: This condition is true for all PyTorch internal libraries, it
//       just excludes external projects such as torch_xla which
//       re-use some of the PyTorch codegen machinery.
#if defined(CAFFE2_BUILD_MAIN_LIB)        || \
    defined(TORCH_CUDA_BUILD_MAIN_LIB)    || \
    defined(TORCH_HIP_BUILD_MAIN_LIB)     || \
    defined(TORCH_XPU_BUILD_MAIN_LIB)     || \
    defined(TORCH_CUDA_CU_BUILD_MAIN_LIB) || \
    defined(TORCH_CUDA_CPP_BUILD_MAIN_LIB)
#define TORCH_ASSERT_ONLY_METHOD_OPERATORS
#endif

// @generated by torchgen/gen.py from RegisterDispatchKey.cpp

#include <c10/core/TensorImpl.h>
#include <c10/core/Allocator.h>
#include <ATen/DeviceGuard.h>
#include <ATen/NamedTensorUtils.h>
#include <ATen/Utils.h>
#include <ATen/WrapDimUtils.h>
#include <ATen/Dispatch.h>
#include <c10/util/ExclusivelyOwned.h>
#include <c10/util/Half.h>
#include <c10/core/UndefinedTensorImpl.h>
#include <optional>
#include <ATen/Tensor.h>
#include <ATen/native/Resize.h>

#include <cstddef>
#include <functional>
#include <memory>
#include <utility>

#include <ATen/Config.h>
#include <ATen/core/op_registration/adaption.h>
#include <torch/library.h>
#include <c10/cuda/CUDAGuard.h>
#include <ATen/cuda/ATenCUDAGeneral.h>
#include <ATen/cuda/CUDADevice.h>
#include <ATen/cuda/CUDAContext.h>

#include <ATen/ops/as_strided_native.h>
#include <ATen/ops/empty.h>
#include <ATen/ops/empty_strided.h>
#include <ATen/ops/_copy_from_and_resize.h>
#include <ATen/ops/_copy_from.h>
#include <c10/macros/Macros.h>
#include <ATen/ops/_adaptive_avg_pool2d_native.h>
#include <ATen/ops/_empty_affine_quantized_native.h>
#include <ATen/ops/_empty_per_channel_affine_quantized_native.h>
#include <ATen/ops/_index_put_impl_native.h>
#include <ATen/ops/_reshape_alias_native.h>
#include <ATen/ops/as_strided_native.h>
#include <ATen/ops/clone_native.h>
#include <ATen/ops/dequantize_native.h>
#include <ATen/ops/empty_like_native.h>
#include <ATen/ops/empty_native.h>
#include <ATen/ops/empty_quantized_native.h>
#include <ATen/ops/empty_strided_native.h>
#include <ATen/ops/fill_native.h>
#include <ATen/ops/flip_native.h>
#include <ATen/ops/gelu_native.h>
#include <ATen/ops/index_select_native.h>
#include <ATen/ops/int_repr_native.h>
#include <ATen/ops/masked_fill_native.h>
#include <ATen/ops/max_native.h>
#include <ATen/ops/min_native.h>
#include <ATen/ops/q_per_channel_axis_native.h>
#include <ATen/ops/q_per_channel_scales_native.h>
#include <ATen/ops/q_per_channel_zero_points_native.h>
#include <ATen/ops/q_scale_native.h>
#include <ATen/ops/q_zero_point_native.h>
#include <ATen/ops/qscheme_native.h>
#include <ATen/ops/quantized_max_pool2d_native.h>
#include <ATen/ops/relu_native.h>
#include <ATen/ops/set_native.h>
#include <ATen/ops/squeeze_native.h>
#include <ATen/ops/unfold_native.h>
#include <ATen/ops/unsqueeze_native.h>
#include <ATen/ops/view_native.h>

namespace at {
namespace {
C10_DIAGNOSTIC_PUSH_AND_IGNORED_IF_DEFINED("-Wunused-function")

Tensor create_out(IntArrayRef sizes, IntArrayRef strides, const TensorOptions &options) {
  if (strides.empty()) {
      return at::empty(sizes, options);
  } else {
      return at::empty_strided(sizes, strides, options);
  }
}

void resize_out(const Tensor &out, IntArrayRef sizes, IntArrayRef strides, const TensorOptions &options) {
  TORCH_CHECK(options.dtype() == out.dtype(),
      "Expected out tensor to have dtype ", options.dtype(), ", but got ", out.dtype(), " instead");
  TORCH_CHECK(options.device() == out.device(),
      "Expected out tensor to have device ", options.device(), ", but got ", out.device(), " instead");
  const bool resized = at::native::resize_output(out, sizes);
  // Only restride if a resize occurred; otherwise we ignore the (advisory)
  // strides from the meta function and directly use the output tensor's
  // preexisting strides
  if (resized) {
    if (!strides.empty()) {
      TORCH_INTERNAL_ASSERT(!options.memory_format_opt().has_value());
      // TODO: avoid the redispatch here
      out.as_strided_(sizes, strides);
    } else if (options.memory_format_opt().has_value()) {
      out.unsafeGetTensorImpl()->empty_tensor_restride(*options.memory_format_opt());
    }
  }
}

void check_inplace(const Tensor &self, IntArrayRef sizes, const TensorOptions &options) {
  // These checks are needed on those operators that:
  //   1) don't use 'TensorIterator' (e.g. 'addmm' and 'baddbmm')
  //   2) have particular typing rules (e.g. 'cumsum' and 'cumprod')
  // For other operators (e.g. 'add'), 'TensorIterator' already checks
  // these things separately.
  TORCH_CHECK(options.dtype() == self.dtype(),
      "Bad in-place call: ",
      "input tensor dtype ", self.dtype(), " and output tensor dtype ", options.dtype(), " should match");
  TORCH_CHECK(options.device() == self.device(),
      "Bad in-place call: ",
      "input tensor device ", self.device(), " and output tensor device ", options.device(), " should match");
  TORCH_CHECK(sizes == self.sizes(),
      "Bad in-place call: ",
      "input tensor size ", self.sizes(), " and output tensor size ", sizes, " should match");
}

std::optional<Tensor> maybe_create_proxy(const Tensor &out, IntArrayRef sizes, IntArrayRef strides, const TensorOptions &options) {
  if (out.strides() != strides) {
    return at::empty_strided(sizes, strides, options);
  }
  return std::nullopt;
}
C10_DIAGNOSTIC_POP()
} // namespace
} // namespace at

// See template file RegisterDispatchDefinitions.ini
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__as_strided(const at::Tensor & self, c10::SymIntArrayRef size, c10::SymIntArrayRef stride, ::std::optional<c10::SymInt> storage_offset) {
    // No device check
  // DeviceGuard omitted
  return at::native::as_strided_qtensorimpl(self, C10_AS_INTARRAYREF_SLOW(size), C10_AS_INTARRAYREF_SLOW(stride), storage_offset.has_value() ? ::std::make_optional(storage_offset->guard_int(__FILE__, __LINE__)) : ::std::nullopt);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("as_strided",
TORCH_FN(wrapper_QuantizedCUDA__as_strided));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor as_strided(const at::Tensor & self, at::IntArrayRef size, at::IntArrayRef stride, ::std::optional<int64_t> storage_offset) {
return wrapper_QuantizedCUDA__as_strided(self, c10::fromIntArrayRefSlow(size), c10::fromIntArrayRefSlow(stride), storage_offset.has_value() ? ::std::make_optional(c10::SymInt(*storage_offset)) : ::std::nullopt);
}
at::Tensor as_strided_symint(const at::Tensor & self, c10::SymIntArrayRef size, c10::SymIntArrayRef stride, ::std::optional<c10::SymInt> storage_offset) {
return wrapper_QuantizedCUDA__as_strided(self, size, stride, storage_offset);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA_memory_format_empty(c10::SymIntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  globalContext().lazyInitDevice(c10::DeviceType::CUDA);
  const DeviceGuard device_guard(device_or_default(device));
  return at::native::empty_unknown_quantized(C10_AS_INTARRAYREF_SLOW(size), dtype, layout, device, pin_memory, memory_format);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("empty.memory_format",
TORCH_FN(wrapper_QuantizedCUDA_memory_format_empty));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor empty(at::IntArrayRef size, at::TensorOptions options, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA_memory_format_empty(c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
}
at::Tensor empty(at::IntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA_memory_format_empty(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory, memory_format);
}
at::Tensor empty_symint(c10::SymIntArrayRef size, at::TensorOptions options, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA_memory_format_empty(size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
}
at::Tensor empty_symint(c10::SymIntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA_memory_format_empty(size, dtype, layout, device, pin_memory, memory_format);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA___empty_affine_quantized(c10::SymIntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, double scale, int64_t zero_point, ::std::optional<at::MemoryFormat> memory_format) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  globalContext().lazyInitDevice(c10::DeviceType::CUDA);
  const DeviceGuard device_guard(device_or_default(device));
  return at::native::empty_affine_quantized(C10_AS_INTARRAYREF_SLOW(size), dtype, layout, device, pin_memory, scale, zero_point, memory_format);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("_empty_affine_quantized",
TORCH_FN(wrapper_QuantizedCUDA___empty_affine_quantized));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor _empty_affine_quantized(at::IntArrayRef size, at::TensorOptions options, double scale, int64_t zero_point, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA___empty_affine_quantized(c10::fromIntArrayRefSlow(size), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), scale, zero_point, c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
}
at::Tensor _empty_affine_quantized(at::IntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, double scale, int64_t zero_point, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA___empty_affine_quantized(c10::fromIntArrayRefSlow(size), dtype, layout, device, pin_memory, scale, zero_point, memory_format);
}
at::Tensor _empty_affine_quantized_symint(c10::SymIntArrayRef size, at::TensorOptions options, double scale, int64_t zero_point, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA___empty_affine_quantized(size, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), scale, zero_point, c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
}
at::Tensor _empty_affine_quantized_symint(c10::SymIntArrayRef size, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, double scale, int64_t zero_point, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA___empty_affine_quantized(size, dtype, layout, device, pin_memory, scale, zero_point, memory_format);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA___empty_per_channel_affine_quantized(c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  globalContext().lazyInitDevice(c10::DeviceType::CUDA);
  const DeviceGuard device_guard(device_or_default(device));
  return at::native::empty_per_channel_affine_quantized(C10_AS_INTARRAYREF_SLOW(size), scales, zero_points, axis, dtype, layout, device, pin_memory, memory_format);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("_empty_per_channel_affine_quantized",
TORCH_FN(wrapper_QuantizedCUDA___empty_per_channel_affine_quantized));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor _empty_per_channel_affine_quantized(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, at::TensorOptions options, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA___empty_per_channel_affine_quantized(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
}
at::Tensor _empty_per_channel_affine_quantized(at::IntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA___empty_per_channel_affine_quantized(c10::fromIntArrayRefSlow(size), scales, zero_points, axis, dtype, layout, device, pin_memory, memory_format);
}
at::Tensor _empty_per_channel_affine_quantized_symint(c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, at::TensorOptions options, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA___empty_per_channel_affine_quantized(size, scales, zero_points, axis, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
}
at::Tensor _empty_per_channel_affine_quantized_symint(c10::SymIntArrayRef size, const at::Tensor & scales, const at::Tensor & zero_points, int64_t axis, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA___empty_per_channel_affine_quantized(size, scales, zero_points, axis, dtype, layout, device, pin_memory, memory_format);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__empty_quantized(at::IntArrayRef size, const at::Tensor & qtensor, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, qtensor, "wrapper_QuantizedCUDA__empty_quantized", "qtensor");
  globalContext().lazyInitDevice(c10::DeviceType::CUDA);
  const DeviceGuard device_guard(device_or_default(device));
  return at::native::empty_quantized(size, qtensor, dtype, layout, device, pin_memory, memory_format);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("empty_quantized",
TORCH_FN(wrapper_QuantizedCUDA__empty_quantized));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor empty_quantized(at::IntArrayRef size, const at::Tensor & qtensor, at::TensorOptions options, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA__empty_quantized(size, qtensor, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
}
at::Tensor empty_quantized(at::IntArrayRef size, const at::Tensor & qtensor, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA__empty_quantized(size, qtensor, dtype, layout, device, pin_memory, memory_format);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__empty_like(const at::Tensor & self, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
    // No device check
  // DeviceGuard omitted
  return at::native::empty_like_quantized(self, dtype, layout, device, pin_memory, memory_format);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("empty_like",
TORCH_FN(wrapper_QuantizedCUDA__empty_like));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor empty_like(const at::Tensor & self, at::TensorOptions options, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA__empty_like(self, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt(), c10::impl::check_tensor_options_and_extract_memory_format(options, memory_format));
}
at::Tensor empty_like(const at::Tensor & self, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA__empty_like(self, dtype, layout, device, pin_memory, memory_format);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__empty_strided(c10::SymIntArrayRef size, c10::SymIntArrayRef stride, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  globalContext().lazyInitDevice(c10::DeviceType::CUDA);
  const DeviceGuard device_guard(device_or_default(device));
  return at::native::empty_strided_unknown_quantized(C10_AS_INTARRAYREF_SLOW(size), C10_AS_INTARRAYREF_SLOW(stride), dtype, layout, device, pin_memory);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("empty_strided",
TORCH_FN(wrapper_QuantizedCUDA__empty_strided));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor empty_strided(at::IntArrayRef size, at::IntArrayRef stride, at::TensorOptions options) {
return wrapper_QuantizedCUDA__empty_strided(c10::fromIntArrayRefSlow(size), c10::fromIntArrayRefSlow(stride), c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
}
at::Tensor empty_strided(at::IntArrayRef size, at::IntArrayRef stride, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory) {
return wrapper_QuantizedCUDA__empty_strided(c10::fromIntArrayRefSlow(size), c10::fromIntArrayRefSlow(stride), dtype, layout, device, pin_memory);
}
at::Tensor empty_strided_symint(c10::SymIntArrayRef size, c10::SymIntArrayRef stride, at::TensorOptions options) {
return wrapper_QuantizedCUDA__empty_strided(size, stride, c10::optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt());
}
at::Tensor empty_strided_symint(c10::SymIntArrayRef size, c10::SymIntArrayRef stride, ::std::optional<at::ScalarType> dtype, ::std::optional<at::Layout> layout, ::std::optional<at::Device> device, ::std::optional<bool> pin_memory) {
return wrapper_QuantizedCUDA__empty_strided(size, stride, dtype, layout, device, pin_memory);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor & wrapper_QuantizedCUDA_Scalar_fill_(at::Tensor & self, const at::Scalar & value) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::fill_quantized_(self, value);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("fill_.Scalar",
TORCH_FN(wrapper_QuantizedCUDA_Scalar_fill_));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor & fill_(at::Tensor & self, const at::Scalar & value) {
return wrapper_QuantizedCUDA_Scalar_fill_(self, value);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor & wrapper_QuantizedCUDA_Tensor_fill_(at::Tensor & self, const at::Tensor & value) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::fill_quantized_(self, value);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("fill_.Tensor",
TORCH_FN(wrapper_QuantizedCUDA_Tensor_fill_));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor & fill_(at::Tensor & self, const at::Tensor & value) {
return wrapper_QuantizedCUDA_Tensor_fill_(self, value);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor & wrapper_QuantizedCUDA___index_put_impl_(at::Tensor & self, const c10::List<::std::optional<at::Tensor>> & indices, const at::Tensor & values, bool accumulate, bool unsafe) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::_index_put_impl_quantized_cuda_(self, indices, values, accumulate, unsafe);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("_index_put_impl_",
TORCH_FN(wrapper_QuantizedCUDA___index_put_impl_));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor & _index_put_impl_(at::Tensor & self, const c10::List<::std::optional<at::Tensor>> & indices, const at::Tensor & values, bool accumulate, bool unsafe) {
return wrapper_QuantizedCUDA___index_put_impl_(self, indices, values, accumulate, unsafe);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
::std::tuple<at::Tensor,at::Tensor> wrapper_QuantizedCUDA_dim_max(const at::Tensor & self, int64_t dim, bool keepdim) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::qmax(self, dim, keepdim);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("max.dim",
TORCH_FN(wrapper_QuantizedCUDA_dim_max));
}
} // anonymous namespace
namespace quantizedcuda {
::std::tuple<at::Tensor,at::Tensor> max(const at::Tensor & self, int64_t dim, bool keepdim) {
return wrapper_QuantizedCUDA_dim_max(self, dim, keepdim);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__quantized_max_pool2d(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__quantized_max_pool2d", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::quantized_max_pool2d_cudnn(self, kernel_size, stride, padding, dilation, ceil_mode);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("quantized_max_pool2d",
TORCH_FN(wrapper_QuantizedCUDA__quantized_max_pool2d));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor quantized_max_pool2d(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef stride, at::IntArrayRef padding, at::IntArrayRef dilation, bool ceil_mode) {
return wrapper_QuantizedCUDA__quantized_max_pool2d(self, kernel_size, stride, padding, dilation, ceil_mode);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
::std::tuple<at::Tensor,at::Tensor> wrapper_QuantizedCUDA_dim_min(const at::Tensor & self, int64_t dim, bool keepdim) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::qmin(self, dim, keepdim);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("min.dim",
TORCH_FN(wrapper_QuantizedCUDA_dim_min));
}
} // anonymous namespace
namespace quantizedcuda {
::std::tuple<at::Tensor,at::Tensor> min(const at::Tensor & self, int64_t dim, bool keepdim) {
return wrapper_QuantizedCUDA_dim_min(self, dim, keepdim);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA___reshape_alias(const at::Tensor & self, c10::SymIntArrayRef size, c10::SymIntArrayRef stride) {
    // No device check
  // DeviceGuard omitted
  return at::native::_reshape_alias(self, C10_AS_INTARRAYREF_SLOW(size), C10_AS_INTARRAYREF_SLOW(stride));
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("_reshape_alias",
TORCH_FN(wrapper_QuantizedCUDA___reshape_alias));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor _reshape_alias(const at::Tensor & self, at::IntArrayRef size, at::IntArrayRef stride) {
return wrapper_QuantizedCUDA___reshape_alias(self, c10::fromIntArrayRefSlow(size), c10::fromIntArrayRefSlow(stride));
}
at::Tensor _reshape_alias_symint(const at::Tensor & self, c10::SymIntArrayRef size, c10::SymIntArrayRef stride) {
return wrapper_QuantizedCUDA___reshape_alias(self, size, stride);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__relu(const at::Tensor & self) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::relu_quantized_cuda(self);
}
} // anonymous namespace
namespace {
at::Tensor & wrapper_QuantizedCUDA__relu_(at::Tensor & self) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::relu_quantized_cuda_(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("relu",
TORCH_FN(wrapper_QuantizedCUDA__relu));
m.impl("relu_",
TORCH_FN(wrapper_QuantizedCUDA__relu_));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor relu(const at::Tensor & self) {
return wrapper_QuantizedCUDA__relu(self);
}
at::Tensor & relu_(at::Tensor & self) {
return wrapper_QuantizedCUDA__relu_(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__gelu(const at::Tensor & self, c10::string_view approximate) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::gelu_quantized_cuda(self, approximate);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("gelu",
TORCH_FN(wrapper_QuantizedCUDA__gelu));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor gelu(const at::Tensor & self, c10::string_view approximate) {
return wrapper_QuantizedCUDA__gelu(self, approximate);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__squeeze(const at::Tensor & self) {
    // No device check
  // DeviceGuard omitted
  return at::native::squeeze_quantized(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("squeeze",
TORCH_FN(wrapper_QuantizedCUDA__squeeze));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor squeeze(const at::Tensor & self) {
return wrapper_QuantizedCUDA__squeeze(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA_dim_squeeze(const at::Tensor & self, int64_t dim) {
    // No device check
  // DeviceGuard omitted
  return at::native::squeeze_quantized(self, dim);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("squeeze.dim",
TORCH_FN(wrapper_QuantizedCUDA_dim_squeeze));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor squeeze(const at::Tensor & self, int64_t dim) {
return wrapper_QuantizedCUDA_dim_squeeze(self, dim);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA_dims_squeeze(const at::Tensor & self, at::IntArrayRef dim) {
    // No device check
  // DeviceGuard omitted
  return at::native::squeeze_quantized(self, dim);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("squeeze.dims",
TORCH_FN(wrapper_QuantizedCUDA_dims_squeeze));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor squeeze(const at::Tensor & self, at::IntArrayRef dim) {
return wrapper_QuantizedCUDA_dims_squeeze(self, dim);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__flip(const at::Tensor & self, at::IntArrayRef dims) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__flip", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::flip(self, dims);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("flip",
TORCH_FN(wrapper_QuantizedCUDA__flip));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor flip(const at::Tensor & self, at::IntArrayRef dims) {
return wrapper_QuantizedCUDA__flip(self, dims);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__unsqueeze(const at::Tensor & self, int64_t dim) {
    // No device check
  // DeviceGuard omitted
  return at::native::unsqueeze_quantized(self, dim);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("unsqueeze",
TORCH_FN(wrapper_QuantizedCUDA__unsqueeze));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor unsqueeze(const at::Tensor & self, int64_t dim) {
return wrapper_QuantizedCUDA__unsqueeze(self, dim);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__clone(const at::Tensor & self, ::std::optional<at::MemoryFormat> memory_format) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__clone", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::quantized_clone(self, memory_format);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("clone",
TORCH_FN(wrapper_QuantizedCUDA__clone));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor clone(const at::Tensor & self, ::std::optional<at::MemoryFormat> memory_format) {
return wrapper_QuantizedCUDA__clone(self, memory_format);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA_self_dequantize(const at::Tensor & self) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA_self_dequantize", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::dequantize_quantized(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("dequantize.self",
TORCH_FN(wrapper_QuantizedCUDA_self_dequantize));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor dequantize(const at::Tensor & self) {
return wrapper_QuantizedCUDA_self_dequantize(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
double wrapper_QuantizedCUDA__q_scale(const at::Tensor & self) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__q_scale", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::q_scale_quant(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("q_scale",
TORCH_FN(wrapper_QuantizedCUDA__q_scale));
}
} // anonymous namespace
namespace quantizedcuda {
double q_scale(const at::Tensor & self) {
return wrapper_QuantizedCUDA__q_scale(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
int64_t wrapper_QuantizedCUDA__q_zero_point(const at::Tensor & self) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__q_zero_point", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::q_zero_point_quant(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("q_zero_point",
TORCH_FN(wrapper_QuantizedCUDA__q_zero_point));
}
} // anonymous namespace
namespace quantizedcuda {
int64_t q_zero_point(const at::Tensor & self) {
return wrapper_QuantizedCUDA__q_zero_point(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__q_per_channel_scales(const at::Tensor & self) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__q_per_channel_scales", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::q_per_channel_scales(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("q_per_channel_scales",
TORCH_FN(wrapper_QuantizedCUDA__q_per_channel_scales));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor q_per_channel_scales(const at::Tensor & self) {
return wrapper_QuantizedCUDA__q_per_channel_scales(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__q_per_channel_zero_points(const at::Tensor & self) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__q_per_channel_zero_points", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::q_per_channel_zero_points(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("q_per_channel_zero_points",
TORCH_FN(wrapper_QuantizedCUDA__q_per_channel_zero_points));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor q_per_channel_zero_points(const at::Tensor & self) {
return wrapper_QuantizedCUDA__q_per_channel_zero_points(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
int64_t wrapper_QuantizedCUDA__q_per_channel_axis(const at::Tensor & self) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__q_per_channel_axis", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::q_per_channel_axis(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("q_per_channel_axis",
TORCH_FN(wrapper_QuantizedCUDA__q_per_channel_axis));
}
} // anonymous namespace
namespace quantizedcuda {
int64_t q_per_channel_axis(const at::Tensor & self) {
return wrapper_QuantizedCUDA__q_per_channel_axis(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__int_repr(const at::Tensor & self) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::int_repr_quantized_cuda(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("int_repr",
TORCH_FN(wrapper_QuantizedCUDA__int_repr));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor int_repr(const at::Tensor & self) {
return wrapper_QuantizedCUDA__int_repr(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::QScheme wrapper_QuantizedCUDA__qscheme(const at::Tensor & self) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__qscheme", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::qscheme_quant(self);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("qscheme",
TORCH_FN(wrapper_QuantizedCUDA__qscheme));
}
} // anonymous namespace
namespace quantizedcuda {
at::QScheme qscheme(const at::Tensor & self) {
return wrapper_QuantizedCUDA__qscheme(self);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor & wrapper_QuantizedCUDA_source_Storage_storage_offset_set_(at::Tensor & self, at::Storage source, c10::SymInt storage_offset, c10::SymIntArrayRef size, c10::SymIntArrayRef stride) {
    // No device check
  // DeviceGuard omitted
  return at::native::set_storage_quantized_(self, source, storage_offset.guard_int(__FILE__, __LINE__), C10_AS_INTARRAYREF_SLOW(size), C10_AS_INTARRAYREF_SLOW(stride));
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("set_.source_Storage_storage_offset",
TORCH_FN(wrapper_QuantizedCUDA_source_Storage_storage_offset_set_));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor & set_(at::Tensor & self, at::Storage source, int64_t storage_offset, at::IntArrayRef size, at::IntArrayRef stride) {
return wrapper_QuantizedCUDA_source_Storage_storage_offset_set_(self, source, storage_offset, c10::fromIntArrayRefSlow(size), c10::fromIntArrayRefSlow(stride));
}
at::Tensor & set__symint(at::Tensor & self, at::Storage source, c10::SymInt storage_offset, c10::SymIntArrayRef size, c10::SymIntArrayRef stride) {
return wrapper_QuantizedCUDA_source_Storage_storage_offset_set_(self, source, storage_offset, size, stride);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor & wrapper_QuantizedCUDA_Scalar_masked_fill_(at::Tensor & self, const at::Tensor & mask, const at::Scalar & value) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::masked_fill__quantized_cuda(self, mask, value);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("masked_fill_.Scalar",
TORCH_FN(wrapper_QuantizedCUDA_Scalar_masked_fill_));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor & masked_fill_(at::Tensor & self, const at::Tensor & mask, const at::Scalar & value) {
return wrapper_QuantizedCUDA_Scalar_masked_fill_(self, mask, value);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor & wrapper_QuantizedCUDA_Tensor_masked_fill_(at::Tensor & self, const at::Tensor & mask, const at::Tensor & value) {
    // No device check
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::masked_fill__quantized_cuda(self, mask, value);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("masked_fill_.Tensor",
TORCH_FN(wrapper_QuantizedCUDA_Tensor_masked_fill_));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor & masked_fill_(at::Tensor & self, const at::Tensor & mask, const at::Tensor & value) {
return wrapper_QuantizedCUDA_Tensor_masked_fill_(self, mask, value);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__view(const at::Tensor & self, c10::SymIntArrayRef size) {
    // No device check
  // DeviceGuard omitted
  return at::native::view(self, C10_AS_INTARRAYREF_SLOW(size));
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("view",
TORCH_FN(wrapper_QuantizedCUDA__view));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor view(const at::Tensor & self, at::IntArrayRef size) {
return wrapper_QuantizedCUDA__view(self, c10::fromIntArrayRefSlow(size));
}
at::Tensor view_symint(const at::Tensor & self, c10::SymIntArrayRef size) {
return wrapper_QuantizedCUDA__view(self, size);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__index_select(const at::Tensor & self, int64_t dim, const at::Tensor & index) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA__index_select", "self");
  c10::impl::check_and_update_common_device(common_device, index, "wrapper_QuantizedCUDA__index_select", "index");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::index_select_quantized_cuda(self, dim, index);
}
} // anonymous namespace
namespace {
at::Tensor & wrapper_QuantizedCUDA_out_index_select_out(const at::Tensor & self, int64_t dim, const at::Tensor & index, at::Tensor & out) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, out, "wrapper_QuantizedCUDA_out_index_select_out", "out");
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA_out_index_select_out", "self");
  c10::impl::check_and_update_common_device(common_device, index, "wrapper_QuantizedCUDA_out_index_select_out", "index");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::index_select_out_cuda(self, dim, index, out);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("index_select",
TORCH_FN(wrapper_QuantizedCUDA__index_select));
m.impl("index_select.out",
TORCH_FN(wrapper_QuantizedCUDA_out_index_select_out));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor index_select(const at::Tensor & self, int64_t dim, const at::Tensor & index) {
return wrapper_QuantizedCUDA__index_select(self, dim, index);
}
at::Tensor & index_select_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index) {
return wrapper_QuantizedCUDA_out_index_select_out(self, dim, index, out);
}
at::Tensor & index_select_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, at::Tensor & out) {
return wrapper_QuantizedCUDA_out_index_select_out(self, dim, index, out);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA__unfold(const at::Tensor & self, int64_t dimension, int64_t size, int64_t step) {
    // No device check
  // DeviceGuard omitted
  return at::native::unfold(self, dimension, size, step);
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("unfold",
TORCH_FN(wrapper_QuantizedCUDA__unfold));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor unfold(const at::Tensor & self, int64_t dimension, int64_t size, int64_t step) {
return wrapper_QuantizedCUDA__unfold(self, dimension, size, step);
}
} // namespace quantizedcuda
} // namespace at
namespace at {
// NB: TORCH_LIBRARY_IMPL must be in an anonymous namespace to avoid
// ambiguity with conflicting identifiers that may have been defined in
// at namespace already.
namespace {
namespace {
at::Tensor wrapper_QuantizedCUDA___adaptive_avg_pool2d(const at::Tensor & self, c10::SymIntArrayRef output_size) {
  std::optional<Device> common_device = std::nullopt;
(void)common_device; // Suppress unused variable warning
  c10::impl::check_and_update_common_device(common_device, self, "wrapper_QuantizedCUDA___adaptive_avg_pool2d", "self");
  const OptionalDeviceGuard device_guard(device_of(self));
  return at::native::adaptive_avg_pool2d_quantized_cuda(self, C10_AS_INTARRAYREF_SLOW(output_size));
}
} // anonymous namespace
TORCH_LIBRARY_IMPL(aten, QuantizedCUDA, m) {
    m.impl("_adaptive_avg_pool2d",
TORCH_FN(wrapper_QuantizedCUDA___adaptive_avg_pool2d));
}
} // anonymous namespace
namespace quantizedcuda {
at::Tensor _adaptive_avg_pool2d(const at::Tensor & self, at::IntArrayRef output_size) {
return wrapper_QuantizedCUDA___adaptive_avg_pool2d(self, c10::fromIntArrayRefSlow(output_size));
}
at::Tensor _adaptive_avg_pool2d_symint(const at::Tensor & self, c10::SymIntArrayRef output_size) {
return wrapper_QuantizedCUDA___adaptive_avg_pool2d(self, output_size);
}
} // namespace quantizedcuda
} // namespace at
