Beispiel #1
0
 def _build_outputs(self) -> List[DataPlaceholder]:
     port = len(self._nodes)
     outputs = []
     for i in range(self._n_outputs):
         name = make_name(make_name(self._name, port, sep=":"), i)
         outputs.append(DataPlaceholder(self, port, name))
     return outputs
def test_repr():
    class DummyStep(Step):
        def somefunc(self, X):
            pass

    step = DummyStep(name="some-step", function="somefunc")
    data_placeholder = DataPlaceholder(step=step, name="some-step/0")
    expected_repr = ("DataPlaceholder(step=DummyStep(name='some-step', "
                     "function='somefunc', n_outputs=1, trainable=True), "
                     "name='some-step/0')")
    assert expected_repr == repr(data_placeholder)
Beispiel #3
0
 def __init__(self, name=None):
     super().__init__(name=name, n_outputs=1)
     self._nodes = [
         Node(
             self,
             [],
             [DataPlaceholder(self, 0, self._name)],
             [],
             None,
             None,
             None,
             False,
         )
     ]
Beispiel #4
0
 def __init__(self, name=None):
     super().__init__(name=name, n_outputs=1)
     self._inputs = []
     self._outputs = [DataPlaceholder(self, self._name)]
     self._targets = []
     self.trainable = False
Beispiel #5
0
 def _build_outputs(self) -> List[DataPlaceholder]:
     outputs = []
     for i in range(self._n_outputs):
         name = make_name(self._name, i)
         outputs.append(DataPlaceholder(self, name))
     return outputs