Skip to content

Conversation

peri044
Copy link
Collaborator

@peri044 peri044 commented Feb 3, 2021

Signed-off-by: Dheeraj Peri peri.dheeraj@gmail.com

Description

Fix unused variable warning in clamp

Type of change

Please delete options that are not relevant and/or add your own.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes

@github-actions github-actions bot added component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler labels Feb 3, 2021
@peri044 peri044 requested a review from narendasan February 3, 2021 07:36
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to C++ style guidelines:

diff --git a/workspace/tests/core/conversion/converters/test_element_wise.cpp b/tmp/changes.txt
index 4b2fe9c..5431e9a 100644
--- a/workspace/tests/core/conversion/converters/test_element_wise.cpp
+++ b/tmp/changes.txt
@@ -172,117 +172,117 @@ TEST(Converters, ATenNeScalarConvertsCorrectly) {
  pointwise_test_helper(graph, true, false, {3, 4, 2});
  ;

-TEST(Converters, ATenClampMinConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenClampMinConvertsCorrectly) {
+    const auto graph = R"IR(
    graph(%x.1 : Tensor):
            %2 : int = prim::Constant[value=-2]()
            %3 : None = prim::Constant()
            %4 : Tensor = aten::clamp(%x.1, %2, %3)
            return (%4))IR";
-  pointwise_test_helper(graph, true);
-}
+    pointwise_test_helper(graph, true);
+  }

-TEST(Converters, ATenClampMaxConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenClampMaxConvertsCorrectly) {
+    const auto graph = R"IR(
    graph(%x.1 : Tensor):
            %2 : int = prim::Constant[value=3]()
            %3 : None = prim::Constant()
            %4 : Tensor = aten::clamp(%x.1, %3, %2)
            return (%4))IR";
-  pointwise_test_helper(graph, true);
-}
+    pointwise_test_helper(graph, true);
+  }

-TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
+    const auto graph = R"IR(
    graph(%x.1 : Tensor):
            %2 : int = prim::Constant[value=3]()
            %3 : int = prim::Constant[value=-2]()
            %4 : Tensor = aten::clamp(%x.1, %3, %2)
            return (%4))IR";
-  pointwise_test_helper(graph, true);
-}
+    pointwise_test_helper(graph, true);
+  }

-TEST(Converters, ATenGreaterThanConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenGreaterThanConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::gt(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::gt(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }

-TEST(Converters, ATenLessThanConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenLessThanConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::lt(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::lt(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }

-TEST(Converters, ATenEqualConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenEqualConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::eq(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenEqualScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenEqualScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::eq(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }

-TEST(Converters, ATenGEConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenGEConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::ge(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenGEScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenGEScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::ge(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }

-TEST(Converters, ATenLEConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenLEConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::le(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenLEScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenLEScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::le(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }
ERROR: Some files do not conform to style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code conforms to Python style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code conforms to Python style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some changes that do not conform to C++ style guidelines:

diff --git a/workspace/tests/core/conversion/converters/test_element_wise.cpp b/tmp/changes.txt
index 4b2fe9c..5431e9a 100644
--- a/workspace/tests/core/conversion/converters/test_element_wise.cpp
+++ b/tmp/changes.txt
@@ -172,117 +172,117 @@ TEST(Converters, ATenNeScalarConvertsCorrectly) {
  pointwise_test_helper(graph, true, false, {3, 4, 2});
  ;

-TEST(Converters, ATenClampMinConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenClampMinConvertsCorrectly) {
+    const auto graph = R"IR(
    graph(%x.1 : Tensor):
            %2 : int = prim::Constant[value=-2]()
            %3 : None = prim::Constant()
            %4 : Tensor = aten::clamp(%x.1, %2, %3)
            return (%4))IR";
-  pointwise_test_helper(graph, true);
-}
+    pointwise_test_helper(graph, true);
+  }

-TEST(Converters, ATenClampMaxConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenClampMaxConvertsCorrectly) {
+    const auto graph = R"IR(
    graph(%x.1 : Tensor):
            %2 : int = prim::Constant[value=3]()
            %3 : None = prim::Constant()
            %4 : Tensor = aten::clamp(%x.1, %3, %2)
            return (%4))IR";
-  pointwise_test_helper(graph, true);
-}
+    pointwise_test_helper(graph, true);
+  }

-TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenClampMinMaxConvertsCorrectly) {
+    const auto graph = R"IR(
    graph(%x.1 : Tensor):
            %2 : int = prim::Constant[value=3]()
            %3 : int = prim::Constant[value=-2]()
            %4 : Tensor = aten::clamp(%x.1, %3, %2)
            return (%4))IR";
-  pointwise_test_helper(graph, true);
-}
+    pointwise_test_helper(graph, true);
+  }

-TEST(Converters, ATenGreaterThanConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenGreaterThanConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::gt(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenGreaterThanScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::gt(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }

-TEST(Converters, ATenLessThanConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenLessThanConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::lt(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenLessThanScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::lt(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }

-TEST(Converters, ATenEqualConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenEqualConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::eq(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenEqualScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenEqualScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::eq(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }

-TEST(Converters, ATenGEConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenGEConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::ge(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenGEScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenGEScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::ge(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }

-TEST(Converters, ATenLEConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenLEConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor, %1 : Tensor):
        %2 : Tensor = aten::le(%0, %1)
        return (%2))IR";
-  pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
-}
+    pointwise_test_helper(graph, false, false, {5, 5}, {5, 5});
+  }

-TEST(Converters, ATenLEScalarConvertsCorrectly) {
-  const auto graph = R"IR(
+  TEST(Converters, ATenLEScalarConvertsCorrectly) {
+    const auto graph = R"IR(
      graph(%0 : Tensor):
        %scalar : float = prim::Constant[value=3]()
        %2 : Tensor = aten::le(%0, %scalar)
        return (%2))IR";
-  pointwise_test_helper(graph, true, false, {5, 5});
-}
+    pointwise_test_helper(graph, true, false, {5, 5});
+  }
ERROR: Some files do not conform to style guidelines

Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will add linting and merge

@github-actions github-actions bot added the component: tests Issues re: Tests label Feb 4, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code conforms to Python style guidelines

peri044 and others added 3 commits February 3, 2021 17:51
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Naren Dasan <naren@narendasan.com>
Signed-off-by: Naren Dasan <narens@nvidia.com>
Signed-off-by: Naren Dasan <naren@narendasan.com>
Signed-off-by: Naren Dasan <narens@nvidia.com>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code conforms to Python style guidelines

@narendasan narendasan merged commit 4903010 into master Feb 4, 2021
@narendasan narendasan deleted the clamp branch February 4, 2021 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants