(self, metadata)
Set up forward hooks.
Set up forward hooks.
Set up forward hooks .
def on_batch_begin(self, metadata):
        """Set up forward hooks."""
        timestamps = metadata.get('timestamps')

        if self.ts is not None and self.ts not in timestamps:
            return

        def hook(model, inp, out):
            self.activations[model] = (inp, out)

        for layer in self.run.network._modules.values():
            self.handles.append(layer.register_forward_hook(hook))
def on_batch_begin ( self , metadata ) : timestamps = metadata . get ( 'timestamps' ) if self . ts is not None and self . ts not in timestamps : return def hook ( model , inp , out ) : self . activations [ model ] = ( inp , out ) for layer in self . run . network . _modules . values ( ) : self . handles . append ( layer . register_forward_hook ( hook ) )