The following issues were found

aten/src/ATen/test/ExclusivelyOwned_test.cpp
1 issues
syntax error
Error

Line: 80

              
TYPED_TEST_CASE(ExclusivelyOwnedTest, ExclusivelyOwnedTypes);

TYPED_TEST(ExclusivelyOwnedTest, DefaultConstructor) {
  c10::ExclusivelyOwned<TypeParam> defaultConstructed;
}

TYPED_TEST(ExclusivelyOwnedTest, MoveConstructor) {
  auto movedDefault = std::move(this->defaultConstructed);

            

Reported by Cppcheck.

aten/src/ATen/test/Dict_test.cpp
1 issues
equal - Function does not check the second iterator for over-read conditions
Security

Line: 10 Column: 45 CWE codes: 126
Suggestion: This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it

              using std::string;
using c10::Dict;

#define ASSERT_EQUAL(t1, t2) ASSERT_TRUE(t1.equal(t2));

TEST(DictTest, givenEmptyDict_whenCallingEmpty_thenReturnsTrue) {
    Dict<int64_t, string> dict;
    EXPECT_TRUE(dict.empty());
}

            

Reported by FlawFinder.

aten/src/ATen/templates/RegisterDispatchKey.cpp
1 issues
syntax error
Error

Line: 49

              
${dispatch_anonymous_definitions}

TORCH_LIBRARY_IMPL(aten, ${DispatchKey}, m) {
  ${dispatch_registrations}
}

} // anonymous namespace


            

Reported by Cppcheck.

aten/src/ATen/templates/RegisterBackendSelect.cpp
1 issues
syntax error
Error

Line: 41

                return op.redispatch(_dk, self, device);
}

TORCH_LIBRARY_IMPL(aten, BackendSelect, m) {
  ${backend_select_function_registrations};
  m.impl(TORCH_SELECTIVE_NAME("aten::is_pinned"), TORCH_FN(is_pinned));
  m.impl(TORCH_SELECTIVE_NAME("aten::_pin_memory"), TORCH_FN(_pin_memory));
}


            

Reported by Cppcheck.

aten/src/ATen/native/xnnpack/RegisterOpContextClass.cpp
1 issues
syntax error
Error

Line: 18

              using internal::convolution2d::createConv2dClampPrePackOpContext;
using internal::convolution2d::createConv2dTransposeClampPrePackOpContext;

TORCH_LIBRARY(xnnpack, m) {
  m.class_<LinearOpContext>("LinearOpContext")
    .def_pickle(
        [](const c10::intrusive_ptr<LinearOpContext>& op_context)
            -> SerializationTypeLinearPrePack { // __getstate__
          return op_context->unpack();

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/ops/Upsample.cpp
1 issues
syntax error
Error

Line: 42

                api::Command::Pool& command_pool = context->command().pool;
  api::Command::Buffer& command_buffer = command_pool.stream();
  {
    if C10_LIKELY(v_input.has_image()) {
      const struct Block final {
        uvec3 extents;
        uint32_t _;
        ivec2 iextents;
        vec2 scale;

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/ops/Softmax.cpp
1 issues
syntax error
Error

Line: 59

                api::Command::Pool& command_pool = context->command().pool;
  api::Command::Buffer& command_buffer = command_pool.stream();
  {
    if C10_LIKELY(v_input.has_image()) {
      const struct Block final {
        uvec3 iextents;
        int last_texel_end_offset;
      } block {
        v_input.extents(),

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/ops/Shape.cpp
1 issues
syntax error
Error

Line: 54

              
#ifdef USE_VULKAN_API

TORCH_LIBRARY_IMPL(aten, Vulkan, m) {
  m.impl(TORCH_SELECTIVE_NAME("aten::view"), TORCH_FN(view));
  m.impl(TORCH_SELECTIVE_NAME("aten::_reshape_alias"), TORCH_FN(_reshape_alias));
}

#endif /* USE_VULKAN_API */

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/ops/Register.cpp
1 issues
syntax error
Error

Line: 47

                        });
}

TORCH_LIBRARY(vulkan_prepack, m) {
  m.def(TORCH_SELECTIVE_SCHEMA(
      "vulkan_prepack::conv2d_clamp_prepack(Tensor W, Tensor? B, int[2] stride, "
      "int[2] padding, int[2] dilation, int groups, "
      "Scalar? output_min=None, Scalar? output_max=None) "
      "-> __torch__.torch.classes.vulkan.Conv2dOpContext"));

            

Reported by Cppcheck.

aten/src/ATen/native/vulkan/ops/Pool.cpp
1 issues
syntax error
Error

Line: 39

                api::Command::Pool& command_pool = context->command().pool;
  api::Command::Buffer& command_buffer = command_pool.stream();
  {
    if C10_LIKELY(v_self.has_image()) {
      const uvec3 v_output_size = v_output.extents();
      const uvec3 v_self_size = v_self.extents();

      const vec2 stride {
        static_cast<float>(v_self_size.data[0u]) / v_output_size.data[0u],

            

Reported by Cppcheck.