Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mul.scalar converter #319

Merged
merged 2 commits into from
Feb 23, 2021
Merged

Add mul.scalar converter #319

merged 2 commits into from
Feb 23, 2021

Conversation

narendasan
Copy link
Collaborator

Description

Adds support for mul.scalar

Type of change

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

  • New feature (non-breaking change which adds functionality)

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

@narendasan narendasan requested a review from peri044 February 4, 2021 21:46
@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 component: tests Issues re: Tests labels 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 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/core/conversion/converters/impl/element_wise.cpp b/tmp/changes.txt
index 775c4be..b16928b 100644
--- a/workspace/core/conversion/converters/impl/element_wise.cpp
+++ b/tmp/changes.txt
@@ -374,8 +374,8 @@ auto element_wise_registrations TRTORCH_UNUSED =
                    auto self = args[0].ITensorOrFreeze(ctx);
                    auto otherScalar = args[1].unwrapToScalar().to<float>();
                    auto other = tensor_to_const(ctx, torch::tensor({otherScalar}));
-                    auto mul = add_elementwise(
-                        ctx, nvinfer1::ElementWiseOperation::kPROD, self, other, util::node_info(n));
+                    auto mul =
+                        add_elementwise(ctx, nvinfer1::ElementWiseOperation::kPROD, self, other, util::node_info(n));
                    TRTORCH_CHECK(mul, "Unable to create mul layer from node: " << *n);

                    mul->setName(util::node_info(n).c_str());
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.

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

diff --git a/workspace/core/conversion/converters/impl/element_wise.cpp b/tmp/changes.txt
index 775c4be..b16928b 100644
--- a/workspace/core/conversion/converters/impl/element_wise.cpp
+++ b/tmp/changes.txt
@@ -374,8 +374,8 @@ auto element_wise_registrations TRTORCH_UNUSED =
                    auto self = args[0].ITensorOrFreeze(ctx);
                    auto otherScalar = args[1].unwrapToScalar().to<float>();
                    auto other = tensor_to_const(ctx, torch::tensor({otherScalar}));
-                    auto mul = add_elementwise(
-                        ctx, nvinfer1::ElementWiseOperation::kPROD, self, other, util::node_info(n));
+                    auto mul =
+                        add_elementwise(ctx, nvinfer1::ElementWiseOperation::kPROD, self, other, util::node_info(n));
                    TRTORCH_CHECK(mul, "Unable to create mul layer from node: " << *n);

                    mul->setName(util::node_info(n).c_str());
ERROR: Some files do not conform to style guidelines

Copy link
Collaborator

@peri044 peri044 left a comment

Choose a reason for hiding this comment

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

LGTM

inocsin and others added 2 commits February 23, 2021 14:12
Signed-off-by: inocsin <vcheungyi@163.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 34f84df into master Feb 23, 2021
@narendasan narendasan deleted the mul_scalar branch February 23, 2021 22:41
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.

3 participants