From commits-return-9834-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Mon Mar 30 10:43:54 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 B6E99180634 for ; Mon, 30 Mar 2020 12:43:53 +0200 (CEST) Received: (qmail 69763 invoked by uid 500); 30 Mar 2020 10:43:53 -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 69754 invoked by uid 99); 30 Mar 2020 10:43:53 -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; Mon, 30 Mar 2020 10:43:53 +0000 From: GitBox To: commits@tvm.apache.org Subject: [GitHub] [incubator-tvm] heliqi opened a new issue #5172: [FRONTEND] tensorflow _stridedSlice function error Message-ID: Date: Mon, 30 Mar 2020 10:43:53 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit heliqi opened a new issue #5172: [FRONTEND] tensorflow _stridedSlice function error URL: https://github.com/apache/incubator-tvm/issues/5172 I find a some problems about the _stridedSlice from relay/frontend/tensorflow.py: 1. when begin < 0 and shrink_axis_mask > 0 ,end error. example: begin = [-1] end= [0] shrink_axis_mask = 1 data_shape = (4,) after _transformask,get result: begin = [3] end = [0]. The correct answer would be 'begin = [3], end = [4]' ``` def _stridedSlice(): def _impl(inputs, attr, params, mod): xxxx def _transform_mask(stride_dim, ellipsis_mask): xxxx if mask & shrink_axis_mask: #Tensorflow make axis with shrink_axis_mask as dimension 1 m_begin[final_index] = data_shape[final_index] + begin[index] \ if begin[index] < 0 else begin[index] #error m_end[final_index] = begin[index] + 1 => m_begin[final_index] + 1 m_stride[final_index] = 1 fshape_indices.append(-2) else: fshape_indices.append(final_index) ``` 2. ``` if not final_output: for i_shape in final_output: if i_shape == 0: return _op.squeeze(out) if not shrink_axis_mask: ret = out else: final_shape = [] for dim in out_shape: if dim != 1: final_shape.append(dim) if len(final_shape) == 0: ret = _op.squeeze(out) else: # We need reshape to handle dynamic shape. ret = _op.reshape(out, newshape=tuple(final_shape)) else: #if 0 in final_output([0],[15,0],etc), should be retrun empty or _op.squeeze(out) ret = _op.reshape(out, newshape=tuple(final_output)) ``` or change judge CHECK_LT to CHECK_LE on src/relay/op/tensor/transform.cc:StridedSliceRel and allow begin_i == end_i . ---------------------------------------------------------------- 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 With regards, Apache Git Services