Skip to main content

lists

List operations.

Note: All the helpers in this module are documented as "Creates foo". This is a shorthand notation for "Adds a node representing an op that returns foo".

list

list(elements: SymbolTuple) -> Symbol

Creates a new list and fills it with elements.

This uses the mo.list.create operation. The elements must have the same type.

Args:

  • elements (SymbolTuple): The list's elements.

Returns:

The list filled with elements. It's type will be MOList.

list(type: MOTensor, g: Graph) -> Symbol

Creates a new empty list of MOTensor elements.

This uses the mo.list.create operation.

Args:

  • type (MOTensor): The list's element type.
  • g (Graph): The Graph to add nodes to.

Returns:

A new empty list. It's type will be MOList.