## Issue When running the code below: ```csharp Tensor x = tf.Variable(tf.ones((2, 2))); Console.WriteLine(x); // https://stackoverflow.com/a/43139565/9920172 x["0", "0"].assign(tf.constant(2)); Console.WriteLine(x); Tensor y = x["0", "0"].assign(tf.constant(2)); Console.WriteLine(y); ``` An error occurs: ``` An unhandled exception of type 'System.ArgumentException' occurred in TensorFlow.NET.dll: 'Dimensions { and { are not compatible' ``` ## In Addition This operation is mentioned in Tensorflow official documentation. Here is the link: <https://www.tensorflow.org/api_docs/python/tf/Variable#__getitem__>. ```python import tensorflow as tf A = tf.Variable([[1,2,3], [4,5,6], [7,8,9]], dtype=tf.float32) with tf.compat.v1.Session() as sess: sess.run(tf.compat.v1.global_variables_initializer()) print(sess.run(A[:2, :2])) # => [[1,2], [4,5]] op = A[:2,:2].assign(22. * tf.ones((2, 2))) print(sess.run(op)) # => [[22, 22, 3], [22, 22, 6], [7,8,9]] ```
Activity
Add test case for Tensor.assign SciSharp#653
Add test case for Tensor.assign #653
fix Variable[slice].assign() #653