You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

BitwiseApiTest.cs 775 B

1234567891011121314151617181920212223242526
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using Tensorflow;
  7. using static Tensorflow.Binding;
  8. namespace TensorFlowNET.UnitTest.TF_API
  9. {
  10. [TestClass]
  11. public class BitwiseApiTest : TFNetApiTest
  12. {
  13. Tensor lhs = tf.constant(new int[] { -1, -5, -3, -14 });
  14. Tensor rhs = tf.constant(new int[] { 5, 0, 7, 11 });
  15. [TestMethod]
  16. public void LeftShift()
  17. {
  18. var left_shift_result = tf.bitwise.left_shift(lhs, rhs);
  19. var expected = new int[] { -32, -5, -384, -28672 };
  20. var actual = left_shift_result.ToArray<int>();
  21. Assert.IsTrue(Enumerable.SequenceEqual(expected, actual));
  22. }
  23. }
  24. }