alexwong commented on a change in pull request #4964: [Torch] Add initial control flow support URL: https://github.com/apache/incubator-tvm/pull/4964#discussion_r386682053
########## File path: python/tvm/relay/frontend/pytorch.py ########## @@ -614,6 +615,55 @@ def _impl(inputs, input_types): return _op.tensor.sqrt(data) return _impl +def _neg(): + def _impl(inputs, input_types): + data = inputs[0] + return _op.tensor.negative(data) + return _impl + +def _tanh(): + def _impl(inputs, input_types): + data = inputs[0] + return _op.tensor.tanh(data) + return _impl + +def _ge(): + def _impl(inputs, input_types): + assert len(inputs) == 2 + lhs = _wrap_const(inputs[0]) + rhs = _wrap_const(inputs[1]) + return _op.tensor.greater_equal(lhs, rhs) + return _impl + +def _gt(): + def _impl(inputs, input_types): + assert len(inputs) == 2 + lhs = _wrap_const(inputs[0]) + rhs = _wrap_const(inputs[1]) + return _op.tensor.greater(lhs, rhs) + return _impl + +def _lt(): + def _impl(inputs, input_types): + assert len(inputs) == 2 + lhs = _wrap_const(inputs[0]) + rhs = _wrap_const(inputs[1]) + return _op.tensor.less(lhs, rhs) + return _impl + +def _Bool(): + def _impl(inputs, input_types): Review comment: I was thinking add an assert on the type of the input since we are just returning it. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services