Add handles to all non-container layers in the model.
        Recursively for non-container layers
556827
def add_handles(self, model, forward_handle, backward_handle):
        
        handles_list = []
        for child in model.children():
            if 'nn.modules.container' in str(type(child)):
                handles_list.extend(self.add_handles(child, forward_handle, backward_handle))
            else:
                handles_list.append(child.register_forward_hook(forward_handle))
                handles_list.append(child.register_backward_hook(backward_handle))
        return handles_list
288325
def make_layer_stack(layers=gin.REQUIRED, num_layers=6):
  
  return LayerStack([cls() for cls in layers] * num_layers)
1175209
def layers(self, value: List['BaseLayer']):
        
        self._layers = list(value)  # type: List[BaseLayer]
        self._index = self._make_index()
        self._transformed = {}
578770
function (layer, props) {
		if (props.handle || objectContainsPathCoords(props)) {
			// Add handles if handle property was added
			removeHandles(layer);
			addHandles(layer);
		} else if (props.handle === null) {
			removeHandles(layer);
		}
		if (isRectLayer(layer)) {
			// If width/height was changed
			if (props.width !== undefined || props.height !== undefined || props.x !== undefined || props.y !== undefined) {
				// Update handle positions
				updateRectHandles(layer);
			}
		} else if (isPathLayer(layer)) {
			updatePathHandles(layer);
		}

	}
747700
def in_channels(m:nn.Module) -> List[int]:
    ""
    for l in flatten_model(m):
        if hasattr(l, 'weight'): return l.weight.shape[1]
    raise Exception('No weight layer')
1026181
def _add_handler(cls, handler, fmt, level):
        
        handler.setFormatter(_get_formatter(fmt))
        if level:
            handler.setLevel(level)
        logging.root.addHandler(handler)
        cls.used_formats = ("%s %s" % (cls.used_formats or "", fmt)).strip()
        cls.handlers.append(handler)
1179952
def add_layer(self, name: str, layer_output):
        
        self.__layers[name] = layer_output
        self.__last_layer_name = name
1304120
def addparentstofks(rels, fks):
    
    for j in rels:
        son = index(fks, j[1])
        parent = index(fks, j[0])
        fks[son][2] = fks[son][2].replace("models.Model", parent)
        if parent not in fks[son][0]:
            fks[son][0].append(parent)
923758
def add(self, name, handler, group_by=None, aggregator=None):
        """"""
        assert self.batch is not None, "No active batch, call start() first"

        items = self.batch.setdefault(name, collections.OrderedDict())
        if group_by is None:
            # None is special as it means no grouping. In this case we must store all
            # the different handlers and call them all.
            items.setdefault(group_by, []).append((None, handler))
        elif aggregator is not None:
            agg = items.get(group_by, [(None, None)])[0][0]
            items[group_by] = [(aggregator(agg), handler)]
        else:
            items[group_by] = [(None, handler)]
1374017
function addHandlers(node, handlers, thisObject){
    node = getNode(node);

    for (var eventType in handlers)
      addHandler(node, eventType, handlers[eventType], thisObject);
  }
444246
def to_wider_model(self, pre_layer_id, n_add):
        
        self.operation_history.append(("to_wider_model", pre_layer_id, n_add))
        pre_layer = self.layer_list[pre_layer_id]
        output_id = self.layer_id_to_output_node_ids[pre_layer_id][0]
        dim = layer_width(pre_layer)
        self.vis = {}
        self._search(output_id, dim, dim, n_add)
        # Update the tensor shapes.
        for u in self.topological_order:
            for v, layer_id in self.adj_list[u]:
                self.node_list[v].shape = self.layer_list[layer_id].output_shape
780243
def putActivations(self, dict):
        
        for name in dict:
            self.layersByName[name].copyActivations( dict[name] )
1228361
function(layer) {
            var layers = this.layers,
                len, n;

            if (layers) {
                len = layers.length;

                // don't add the layer if it already exists
                for (n = 0; n < len; n++) {
                    if (layers[n]._id === layer._id) {
                        return false;
                    }
                }
            }
            else {
                this.layers = [];
            }

            this.layers.push(layer);
            return true;
        }
1339820
function updateNestedModels() {
  nestedRegistry.models = [];
  _.each(nestedRegistry.views, function(view) {
    var data = (view.obj.model || view.obj.collection);
    if (data) {
      nestedRegistry.models.push(flatRegistry.models[data.getDebugName()]);
    }
  });
}
1252650
def add(self, models):
        
        if models is None:
            return

        models = self._check_model_types(models)
        self._selected.update(models)
        self._selected = reduce_to_parent_states(self._selected)
1173219
function addPathGuides($canvas, parent) {
	var handles = parent._handles,
		prevHandle, nextHandle, otherHandle,
		handle, h,
		guide, guideProps;
	guideProps = $.extend({}, parent.guide, {
		layer: true,
		draggable: false,
		type: 'line'
	});
	if (parent._method === $.fn.drawQuadratic) {
		$canvas.addLayer(guideProps);
		parent._guide = $canvas.getLayer(-1);
		$canvas.moveLayer(parent._guide, -handles.length - 1);
	} else if (parent._method === $.fn.drawBezier) {
		parent._guides = [];
		for (h = 0; h < handles.length; h += 1) {
			handle = handles[h];
			nextHandle = handles[h + 1];
			prevHandle = handles[h - 1];
			otherHandle = null;
			if (nextHandle !== undefined) {
				// If handle is a start/end point and next handle is a control point
				if (handle._xProp.indexOf('x') === 0 && nextHandle._xProp.indexOf('cx') === 0) {
					otherHandle = nextHandle;
				}
			} else if (prevHandle !== undefined) {
				if (prevHandle._xProp.indexOf('cx') === 0 && handle._xProp.indexOf('x') === 0) {
					otherHandle = prevHandle;
				}
			}
			if (otherHandle !== null) {
				$canvas.addLayer(guideProps);
				guide = $canvas.getLayer(-1);
				guide._handles = [handle, otherHandle];
				parent._guides.push(guide);
				$canvas.moveLayer(guide, -handles.length - 1);
			}
		}
	}
	updatePathGuides(parent);
}
857344
public static void addDeclaredMethodsFromInterfaces(ClassNode cNode, Map<String, MethodNode> methodsMap) {
        // add in unimplemented abstract methods from the interfaces
        for (ClassNode iface : cNode.getInterfaces()) {
            Map<String, MethodNode> ifaceMethodsMap = iface.getDeclaredMethodsMap();
            for (Map.Entry<String, MethodNode> entry : ifaceMethodsMap.entrySet()) {
                String methSig = entry.getKey();
                if (!methodsMap.containsKey(methSig)) {
                    methodsMap.put(methSig, entry.getValue());
                }
            }
        }
    }