Add branch() and defer()
Convert layer_histogram to use branch