Add TensorReplace to replace tensors.