How to implement tensor slice assignment

input is a 2-D tensor, newvalue is a 1-D tensor,
I just want to implement a simple assignment, for example input[0]=newvalue.

def func(state ..):
  index = te.var("index")
  newvalue = te.compute(...)
  ..
  # TypeError: 'Tensor' object does not support item assignment
  state[index]  = newvalue

  ..
  # SyntaxError: expression cannot contain assignment, perhaps you meant "=="?
  _ = te.compute((1024), lambda i: state[5*index][i] = newvalue[i])

It is really hard for new beginner, any body can help me?