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

[TOPI] Numpy consistency: always broadcast binary op. #1321

Merged
merged 1 commit into from
Jun 22, 2018

Conversation

tqchen
Copy link
Member

@tqchen tqchen commented Jun 22, 2018

List of Operators

  • add
  • subtract
  • multiply
  • divide
  • mod
  • maximum
  • minimum
  • power
  • left_shift
  • right_shift
  • greater
  • less

topi/src/topi.cc Outdated
@@ -149,10 +148,11 @@ TVM_REGISTER_GLOBAL("topi.negative")
*rv = negative(args[0]);
});

/*
Copy link
Contributor

Choose a reason for hiding this comment

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

@tqchen is there any reason why this is commented out instead of deleted?

verify_broadcast_binary_ele((32,), (64, 32), typ="maximum")
verify_broadcast_binary_ele((1, 2, 2, 1, 32), (64, 32), typ="minimum")
verify_broadcast_binary_ele(
(5, 2, 3), (2, 1), topi.add, np.add)
Copy link
Contributor

Choose a reason for hiding this comment

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

fix indentation

verify_broadcast_binary_ele(
(5, 2, 3), (), topi.subtract, np.subtract)
verify_broadcast_binary_ele(
(5, 2, 3), None, topi.subtract, np.subtract)
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Contributor

@tmoreau89 tmoreau89 left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. Left minor comments on cosmetics.

@tqchen tqchen changed the title [TOPI] always broadcast binary op, add, subtract, multiply, power. [TOPI] Numpy consistency: always broadcast binary op. Jun 22, 2018
@tqchen tqchen force-pushed the master branch 2 times, most recently from bff71d0 to cd507b1 Compare June 22, 2018 23:24
@tqchen tqchen merged commit 2550864 into apache:master Jun 22, 2018
@tqchen
Copy link
Member Author

tqchen commented Jun 22, 2018

@tmoreau89 you might need to update downstream call to broadcast_ops as they are renamed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants