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.

ConstantTest.cs 599 B

12345678910111213141516171819202122232425262728
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using Tensorflow;
  6. namespace TensorFlowNET.UnitTest
  7. {
  8. [TestClass]
  9. public class ConstantTest
  10. {
  11. Tensor tensor;
  12. [TestMethod]
  13. public void ScalarConst()
  14. {
  15. tensor = tf.constant(8); // int
  16. tensor = tf.constant(6.0f); // float
  17. tensor = tf.constant(6.0); // double
  18. }
  19. [TestMethod]
  20. public void StringConst()
  21. {
  22. tensor = tf.constant("Elephant");
  23. }
  24. }
  25. }

tensorflow框架的.NET版本,提供了丰富的特性和API,可以借此很方便地在.NET平台下搭建深度学习训练与推理流程。

Contributors (1)