For strided_slice(data, begin, end, strides=None) , when begin=[0] and end=[0], strided_slice should return an empty array. Currently strided_slice will raise an error.
Can we adjust the code so strided_slice will return an empty array instead of raising an error?
There’s another piece of information,an error occurred while obtaining the end value:
def _stridedSlice():
xxxx
end = _get_list_param(params, inputs[2])
xxxx
error info:
<class 'tvm.relay.expr.Call'> has no attribute name_hint
So,I change the code:
try:
end = _get_list_param(params, inputs[2])
except (IndexError, KeyError, AttributeError):
end = _infer_value(inputs[2], params).asnumpy().tolist()
Finally,I get the ‘end’ value of 0(end = [0]).But begin = [-1], after running ‘_transform_mask’ function, begin = [3] (because input shape is (4,),so [-1:] == [3:]).
I think the ‘end = _infer_value(inputs[2], params).asnumpy().tolist()’ is wrong. if not have ‘end’,the ‘enc’ value may be ‘len(inputs[0])’. example:
fn (%map/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3_loop_var: List[static_tensor_float32_15130_4_t[]], %map/Const_loop_var: int32) {
%0 = take(%map/Const_loop_var, 0);
%1 = @tensor_array_read_float32_15130_4(%map/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3_loop_var, %0);
%2 = @tensor_get_data_float32_15130_4(%1);
strided_slice(%2, begin=[0, 3], end=[15130, 0], strides=[1, 1]) an internal invariant was violated while typechecking your program [09:38:40] /home/ww/2020/tvm_latest/incubator-tvm/src/relay/op/tensor/transform.cc:2102: Check failed: begin_v <= end_v (3 vs. 0) : strided_slice get invalid slice at axis 1
And I use ./incubator-tvm/tests/python/frontend/tensorflow/test_forward.py test_forward_ssd() to do the test. I just modify model_path, shape, in_node and out_node