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

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