class_docstr: A collection of remote modules (of type RemoteModule) with connections showing how inputs
  to the model or outputs of individual modules are use as inputs of subsequent modules.
  The graph has a number of helper functions that add new modules to the graph and define inputs
  to these module.
docstr: Adds a module with specified inputs to the graph. The modules that provide inputs to this module must have
  been added previously to the graph and are listed with argument inputs. If the module output is a tuple,
  num_outputs specifies the number of elements in the tuple.
docstr_tok: ["Adds","a","module","with","specified","inputs","to","the","graph",".","The","modules","that","provide","inputs","to","this","module","must","have","been","added","previously","to","the","graph","and","are","listed","with","argument","inputs",".","If","the","module","output","is","a","tuple",",","num_outputs","specifies","the","number","of","elements","in","the","tuple","."]
code: def add_layer(
      self,
      module: RemoteModule,
      inputs: List[DataSourceSpec],
      num_outputs: Optional[int] = None,
  ) -> None:
      """Adds a module with specified inputs to the graph. The modules that provide inputs to this module must have
      been added previously to the graph and are listed with argument inputs. If the module output is a tuple,
      num_outputs specifies the number of elements in the tuple.
      """
      node = Node(module)
      node.inputs = [
          self._data_source_spec_to_data_source(spec) for spec in inputs
      ]
      node.num_outputs = num_outputs
      self.nodes.append(node)
  
imports: from dataclasses import dataclass
  from typing import List, Optional, Set, Tuple, Union
  from torch import Tensor, nn
  from torch.distributed import rpc
  from torch.distributed.nn import RemoteModule
  from .data import DataConsumer
label_desc: Use image node_id 5 for calling the PipelineModulesGraph obj's underlying member method code with example usage: obj.add_layer(module, inputs, num_outputs) without return types