Skip to contents

This is a mostly internal function that is used in PipeOpTorchs with multiple input channels.

It creates the union of multiple ModelDescriptors:

  • graphs are combinded (if they are not identical to begin with). The first entry's graph is modified by reference.

  • PipeOps with the same ID must be identical. No new input edges may be added to PipeOps.

  • Drops pointer / pointer_shape entries.

  • The new task is the feature union of the two incoming tasks.

  • The optimizer and loss of both ModelDescriptors must be identical.

  • Ingress tokens and callbacks are merged, where objects with the same "id" must be identical.

Usage

model_descriptor_union(md1, md2)

Arguments

md1

(ModelDescriptor) The first ModelDescriptor.

md2

(ModelDescriptor) The second ModelDescriptor.

Details

The requirement that no new input edgedes may be added to PipeOps is not theoretically necessary, but since we assume that ModelDescriptor is being built from beginning to end (i.e. PipeOps never get new ancestors) we can make this assumption and simplify things. Otherwise we'd need to treat "..."-inputs special.)