def __call__(self, x=None): """ Some other modules point to current module :param x: upstream module nodes. x is either a Node or list of Node. :return: node containing current module """ x = to_list(x if x else []) layer = self if isinstance(self, Lambda): input_shapes = [ ZooKerasLayer.of(node.element().value).get_output_shape() for node in x ] layer = self.create(remove_batch(input_shapes)) return Node.of( callBigDlFunc(self.bigdl_type, "createNode", layer, to_list(x)))
def node(self): return Node.of(self.value.node())