def _maybe_assert_valid_sample(self, x):
if not self.validate_args:<EOL><INDENT>return x<EOL><DEDENT>return distribution_util.with_dependencies([<EOL>assert_util.assert_positive(x, message="<STR_LIT>"),<EOL>assert_util.assert_near(<EOL>tf.ones([], dtype=self.dtype),<EOL>tf.reduce_sum(input_tensor=x, axis=-<NUM_LIT:1>),<EOL>message="<STR_LIT>"),<EOL>], x)<EOL>
Checks the validity of a sample.