Skip to content

Module

source

Module(
   inputs, output = None, dependencies = None, name = 'module'
)

Module Layer

Creates a single Layer object from an existing graph defined between a set of inputs and a single output layer. The resulting object can be reused with other inputs just like any other Layer.

Note

The difference between a Module and a Graph is that a Module has a single output, and can be used as a Layer. A layer graph is a utility to group multiple layers into a single function —possibly with multiple outputs.

Raises

  • ValueError : is raised if an input layer does not connect to the output. A Module needs to be a self-contained layer graph.

Args

  • inputs (Layer or List[Layer]) : one or more input layers
  • output (Layer or None) : output layer; if no inputs are passed, it follows the graph backwards from the output

Methods:

.compute_shape

source

.compute_shape()

.init_state

source

.init_state()

.compute

source

.compute(
   *input_tensors
)

.reuse_with

source

.reuse_with(
   *inputs, name = None
)