From commits-return-13145-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Fri May 8 11:02:02 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 72173180667 for ; Fri, 8 May 2020 13:02:02 +0200 (CEST) Received: (qmail 76457 invoked by uid 500); 8 May 2020 11:02:01 -0000 Mailing-List: contact commits-help@tvm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tvm.apache.org Delivered-To: mailing list commits@tvm.apache.org Received: (qmail 76257 invoked by uid 99); 8 May 2020 11:02:01 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2020 11:02:01 +0000 From: =?utf-8?q?GitBox?= To: commits@tvm.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-tvm=5D_dhruvaray_commented_on_a_change_i?= =?utf-8?q?n_pull_request_=235329=3A_=5BFrontend=5D=5BTFLite=5D_Add_parser_s?= =?utf-8?q?upport_for_shape_and_range?= Message-ID: <158893572156.4590.12374040979127655282.asfpy@gitbox.apache.org> Date: Fri, 08 May 2020 11:02:01 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit References: In-Reply-To: dhruvaray commented on a change in pull request #5329: URL: https://github.com/apache/incubator-tvm/pull/5329#discussion_r422081555 ########## File path: python/tvm/relay/frontend/tflite.py ########## @@ -579,6 +582,63 @@ def convert_tanh(self, op): return out + def convert_range(self, op): + """Convert TFLite Range""" + try: + from tflite.Operator import Operator + from tflite.TensorType import TensorType + except ImportError: + raise ImportError("The tflite package must be installed") + + if self.is_quantized(op): + raise tvm.error.OpNotImplemented( + 'TFlite quantized RANGE operator is not supported yet.') + + assert isinstance(op, Operator) + input_tensors = self.get_input_tensors(op) + assert len(input_tensors) == 3, "input tensors length should be 3" + + start, limit, delta = input_tensors[0], input_tensors[1], input_tensors[2] + expressions = [] + + for t in [start, limit, delta]: + if self.has_expr(t.tensor_idx): + expressions.append(self.get_expr(t.tensor_idx)) + else: + tensor_type = self.get_tensor_type_str(t.tensor.Type()) + tensor_value = self.get_tensor_value(t) + expressions.append(self.exp_tab.new_const(tensor_value, dtype=tensor_type)) + Review comment: Yes... fixed... ---------------------------------------------------------------- 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: users@infra.apache.org