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.

Merge.cs 1.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using static Tensorflow.Binding;
  5. using Tensorflow.Keras.ArgsDefinition;
  6. using Tensorflow.Keras.Engine;
  7. using Tensorflow.Keras.Saving;
  8. using Tensorflow.Common.Types;
  9. namespace Tensorflow.Keras.Layers
  10. {
  11. public abstract class Merge : Layer
  12. {
  13. public Merge(MergeArgs args) : base(args)
  14. {
  15. }
  16. public override void build(KerasShapesWrapper input_shape)
  17. {
  18. // output_shape = input_shape.dims[1^];
  19. _buildInputShape = input_shape;
  20. }
  21. <<<<<<< HEAD
  22. protected override Tensors Call(Tensors inputs, Tensors state = null, bool? training = null, IOptionalArgs? optional_args = null)
  23. =======
  24. protected override Tensors Call(Tensors inputs, Tensor mask = null, bool? training = null, Tensors initial_state = null, Tensors constants = null)
  25. >>>>>>> master
  26. {
  27. return _merge_function(inputs);
  28. }
  29. protected virtual Tensors _merge_function(Tensors inputs)
  30. {
  31. var output = inputs[0];
  32. foreach (var i in range(1, inputs.Length))
  33. output += inputs[i];
  34. return output;
  35. }
  36. }
  37. }