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.

Node.IterateInbound.cs 547 B

4 years ago
4 years ago
1234567891011121314151617181920
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. namespace Tensorflow.Keras.Engine
  4. {
  5. public partial class Node
  6. {
  7. public ILayer[] InboundLayers
  8. => iterate_inbound().Select(x => x.Item1).ToArray();
  9. public IEnumerable<(ILayer, int, int, Tensor)> iterate_inbound()
  10. {
  11. foreach (var kt in KerasInputs)
  12. {
  13. var (layer, node_index, tensor_index) = kt.KerasHistory;
  14. yield return (layer, node_index, tensor_index, kt);
  15. }
  16. }
  17. }
  18. }