MCPcopy
hub / github.com/hyperopt/hyperopt / clone_from_inputs

Method clone_from_inputs

hyperopt/pyll/base.py:400–411  ·  view source on GitHub ↗
(self, inputs, o_len="same")

Source from the content-addressed store, hash-verified

398 self.named_args.sort()
399
400 def clone_from_inputs(self, inputs, o_len="same"):
401 if len(inputs) != len(self.inputs()):
402 raise TypeError()
403 L = len(self.pos_args)
404 pos_args = list(inputs[:L])
405 named_args = [
406 [kw, inputs[L + ii]] for ii, (kw, arg) in enumerate(self.named_args)
407 ]
408 # -- danger cloning with new inputs can change the o_len
409 if o_len == "same":
410 o_len = self.o_len
411 return self.__class__(self.name, pos_args, named_args, o_len)
412
413 def replace_input(self, old_node, new_node):
414 rval = []

Callers 3

build_posteriorFunction · 0.45
cloneFunction · 0.45
clone_mergeFunction · 0.45

Calls 1

inputsMethod · 0.95

Tested by

no test coverage detected