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.

ShapeTestCase.cs 710 B

123456789101112131415161718192021222324
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using Tensorflow;
  3. using Tensorflow.UnitTest;
  4. namespace TensorFlowNET.UnitTest.control_flow_ops_test
  5. {
  6. /// <summary>
  7. /// excerpt of tensorflow/python/framework/ops/control_flow_ops_test.py
  8. /// </summary>
  9. [TestClass]
  10. public class ShapeTestCase : GraphModeTestBase
  11. {
  12. [TestMethod]
  13. public void testShape()
  14. {
  15. var tensor = constant_op.constant(new[] { 1.0, 2.0 });
  16. self.assertEquals(new int[] { 2 }, tensor.shape);
  17. self.assertEquals(new int[] { 2 },
  18. control_flow_ops.with_dependencies(new[] { constant_op.constant(1.0).op }, tensor).shape);
  19. }
  20. }
  21. }