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 690 B

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