Package ai.djl.nn

Class BlockList

  • All Implemented Interfaces:
    java.lang.Iterable<ai.djl.util.Pair<java.lang.String,​Block>>

    public class BlockList
    extends ai.djl.util.PairList<java.lang.String,​Block>
    Represents a set of names and Blocks.
    • Constructor Summary

      Constructors 
      Constructor Description
      BlockList()
      Creates an empty BlockList.
      BlockList​(int initialCapacity)
      Constructs an empty BlockList with the specified initial capacity.
      BlockList​(java.util.List<ai.djl.util.Pair<java.lang.String,​Block>> list)
      Constructs a BlockList containing the elements of the specified list of Pairs.
      BlockList​(java.util.List<java.lang.String> keys, java.util.List<Block> values)
      Constructs a BlockList containing the elements of the specified keys and values.
      BlockList​(java.util.Map<java.lang.String,​Block> map)
      Constructs a BlockList containing the elements of the specified map.
    • Method Summary

      • Methods inherited from class ai.djl.util.PairList

        add, add, add, addAll, clear, contains, equals, get, get, hashCode, indexOf, isEmpty, iterator, keyArray, keyAt, keys, remove, remove, size, stream, subList, subList, toMap, toMap, unique, valueArray, valueAt, values
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • BlockList

        public BlockList()
        Creates an empty BlockList.
      • BlockList

        public BlockList​(int initialCapacity)
        Constructs an empty BlockList with the specified initial capacity.
        Parameters:
        initialCapacity - the initial capacity of the list
        Throws:
        java.lang.IllegalArgumentException - if the specified initial capacity is negative
      • BlockList

        public BlockList​(java.util.List<java.lang.String> keys,
                         java.util.List<Block> values)
        Constructs a BlockList containing the elements of the specified keys and values.
        Parameters:
        keys - the key list containing the elements to be placed into this BlockList
        values - the value list containing the elements to be placed into this BlockList
        Throws:
        java.lang.IllegalArgumentException - if the keys and values size are different
      • BlockList

        public BlockList​(java.util.List<ai.djl.util.Pair<java.lang.String,​Block>> list)
        Constructs a BlockList containing the elements of the specified list of Pairs.
        Parameters:
        list - the list containing the elements to be placed into this BlockList
      • BlockList

        public BlockList​(java.util.Map<java.lang.String,​Block> map)
        Constructs a BlockList containing the elements of the specified map.
        Parameters:
        map - the map containing keys and values