def distribution_filter_for(bijector):
if isinstance(bijector, tfb.CholeskyToInvCholesky):<EOL><INDENT>def additional_check(dist):<EOL><INDENT>return (tensorshape_util.rank(dist.event_shape) == <NUM_LIT:2> and<EOL>int(dist.event_shape[<NUM_LIT:0>]) == int(dist.event_shape[<NUM_LIT:1>]))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>additional_check = lambda dist: True<EOL><DEDENT>def distribution_filter(dist):<EOL><INDENT>if not dtype_util.is_floating(dist.dtype):<EOL><INDENT>return False<EOL><DEDENT>if bijector.forward_min_event_ndims > tensorshape_util.rank(<EOL>dist.event_shape):<EOL><INDENT>return False<EOL><DEDENT>return additional_check(dist)<EOL><DEDENT>return distribution_filter<EOL>
Returns filter function f s.t. f(dist)=True => bijector can act on dist.