MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / __init__

Method __init__

tensorflow/python/keras/testing_utils.py:444–464  ·  view source on GitHub ↗

Instantiate a model. Args: layers: a list of layers to be added to the model. *args: Model's args **kwargs: Model's keyword args, at most one of input_tensor -> the input tensor required for ragged/sparse input.

(self, layers, *args, **kwargs)

Source from the content-addressed store, hash-verified

442 """A Keras subclass model."""
443
444 def __init__(self, layers, *args, **kwargs):
445 """Instantiate a model.
446
447 Args:
448 layers: a list of layers to be added to the model.
449 *args: Model's args
450 **kwargs: Model's keyword args, at most one of
451 input_tensor -> the input tensor required for ragged/sparse input.
452 """
453
454 inputs = kwargs.pop('input_tensor', None)
455 super(_SubclassModel, self).__init__(*args, **kwargs)
456 # Note that clone and build doesn't support lists of layers in subclassed
457 # models. Adding each layer directly here.
458 for i, layer in enumerate(layers):
459 setattr(self, self._layer_name_for_i(i), layer)
460
461 self.num_layers = len(layers)
462
463 if inputs is not None:
464 self._set_inputs(inputs)
465
466 def _layer_name_for_i(self, i):
467 return 'layer{}'.format(i)

Callers 5

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 3

_layer_name_for_iMethod · 0.95
_set_inputsMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected