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.

ModelSaveTest.cs 828 B

1234567891011121314151617181920212223242526272829
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using Tensorflow.Keras.Engine;
  3. using static Tensorflow.KerasApi;
  4. namespace TensorFlowNET.UnitTest.Keras
  5. {
  6. /// <summary>
  7. /// https://www.tensorflow.org/guide/keras/save_and_serialize
  8. /// </summary>
  9. [TestClass]
  10. public class ModelSaveTest : EagerModeTestBase
  11. {
  12. [TestMethod, Ignore]
  13. public void GetAndFromConfig()
  14. {
  15. var model = GetFunctionalModel();
  16. var config = model.get_config();
  17. }
  18. Functional GetFunctionalModel()
  19. {
  20. // Create a simple model.
  21. var inputs = keras.Input(shape: 32);
  22. var dense_layer = keras.layers.Dense(1);
  23. var outputs = dense_layer.Apply(inputs);
  24. return keras.Model(inputs, outputs);
  25. }
  26. }
  27. }