parameters: (data, int_index)
return_statement: return P.StridedSlice(begin_mask, end_mask, 0, 0, shrink_axis_mask)(data, begin_strides, end_strides, step_strides)
docstring: Tensor getitem by a single integer number
docstring_summary: Tensor getitem by a single integer number
docstring_tokens: Tensor getitem by a single integer number
function: def _tensor_index_by_integer(data, int_index):
      """Tensor getitem by a single integer number"""
      if data.ndim < 1 or data.ndim > 8:
          const_utils.raise_value_error("Expect Tensor to have dimension between 1 and 8.")
  
      data_shape = F.shape(data)
      transformed_number = const_utils.check_range(int_index, data_shape[0])
      begin_strides, end_strides, step_strides = const_utils.get_stride_info_from_integer(data_shape, transformed_number)
      shrink_axis_mask = 1
      begin_mask = 0
      end_mask = 0
      for i in range(1, len(data_shape)):
          begin_mask += 2**i
          end_mask += 2**i
      return P.StridedSlice(begin_mask, end_mask, 0, 0, shrink_axis_mask)(data, begin_strides, end_strides, step_strides)
function_tokens: def _tensor_index_by_integer ( data , int_index ) : if data . ndim < 1 or data . ndim > 8 : const_utils . raise_value_error ( "Expect Tensor to have dimension between 1 and 8." ) data_shape = F . shape ( data ) transformed_number = const_utils . check_range ( int_index , data_shape [ 0 ] ) begin_strides , end_strides , step_strides = const_utils . get_stride_info_from_integer ( data_shape , transformed_number ) shrink_axis_mask = 1 begin_mask = 0 end_mask = 0 for i in range ( 1 , len ( data_shape ) ) : begin_mask += 2 ** i end_mask += 2 ** i return P . StridedSlice ( begin_mask , end_mask , 0 , 0 , shrink_axis_mask ) ( data , begin_strides , end_strides , step_strides )