code: def strided_set(a, v, begin, end, strides=None):
      """Set slice of an array.
  
      Parameters
      ----------
      a : tvm.te.Tensor
          The tensor to be sliced.
  
      v : tvm.te.Tensor
          The values to set
  
      begin: tvm.te.Tensor
          The indices to begin with in the slicing.
  
      end: tvm.te.Tensor
          Indices indicating end of the slice.
  
      strides: tvm.te.Tensor, optional
          Specifies the stride values, it can be negative
          in that case, the input tensor will be reversed
          in that particular axis.
  
      Returns
      -------
      ret : tvm.te.Tensor
      """
      n = len(a.shape)
  
      if len(begin.shape) != 1:
          raise ValueError("begin should be a vector")
      if not begin.dtype == "int32":
          raise TypeError("begin should be int32")
      if len(end.shape) != 1:
          raise ValueError("end should be a vector")
      if not end.dtype == "int32":
          raise TypeError("end should be int32")
      if strides is not None:
          if len(strides.shape) != 1:
              raise ValueError("strides should be a vector")
          if not strides.dtype == "int32":
              raise TypeError("strides should be int32")
  
      def _max(a, b):
          return tvm.tir.Select(a > b, a, b)
  
      if strides is None:
          strides = [tvm.tir.const(1, "int32")] * n
      else:
          strides = [
              tvm.tir.if_then_else(
                  strides.shape[0] > i,
                  strides[i],
                  tvm.tir.const(1, "int32"),
              )
              for i in range(n)
          ]
  
      begin = [
          tvm.tir.if_then_else(
              begin.shape[0] > i,
              begin[i],
              tvm.tir.Select(
                  strides[i] > 0, tvm.tir.const(0, "int32"), a.shape[i]
              ),
          )
          for i in range(n)
      ]
      end = [
          tvm.tir.if_then_else(
              end.shape[0] > i,
              end[i],
              tvm.tir.Select(
                  strides[i] > 0, a.shape[i] + 1, -(a.shape[i] + 1)
              ),
          )
          for i in range(n)
      ]
  
      # Convert negative indexes
      for i in range(n):
          begin[i] = tvm.tir.if_then_else(
              begin[i] < 0, begin[i] + a.shape[i], begin[i]
          )
          end[i] = tvm.tir.if_then_else(
              end[i] < 0, end[i] + a.shape[i], end[i]
          )
  
      def _select(*indices):
          from_val = []
          index_tuple = []
          for i in range(n):
              from_val.append(
                  within_index(begin[i], end[i], strides[i], indices[i])
              )
              index_tuple.append(
                  make_idx(
                      begin[i],
                      end[i],
                      strides[i],
                      a.shape[i],
                      indices[i],
                  )
              )
          return tvm.tir.if_then_else(
              tvm.tir.all(*from_val), v(*index_tuple), a(*indices)
          )
  
      return te.compute(a.shape, _select, name="strided_set")
  
imports: from __future__ import absolute_import
  import tvm
  from tvm import te, topi
  from tvm.te import hybrid
  from .None import cpp, tag
  from .utils import const_vector, make_idx, within_index
label_desc: Use image node_id 7 for calling a global function with example usage: strided_set(a, v, begin, end, strides) and returns: te, tvm, tvm