<commit_before>from chainer import distributions
from chainer import testing
import numpy


@testing.parameterize(*testing.product({
    'shape': [(3, 2), (1,)],
    'is_variable': [True, False],
    'sample_shape': [(3, 2), ()],
}))
@testing.fix_random()
@testing.with_requires('scipy')
class TestMultivariateNormal(testing.distribution_unittest):

    def setUp(self):
        testing.distribution_unittest.setUp(self)
        from scipy import stats
        self.dist = distributions.MultivariateNormal
        self.scipy_dist = stats.multivariate_normal
        self.scipy_onebyone = True
        self.event_shape = (3,)

        self.test_targets = set([
            "batch_shape", "entropy", "event_shape", "log_prob",
            "support"])

    def params_init(self):
        loc = numpy.random.uniform(
            -1, 1, self.shape + (3,)).astype(numpy.float32)
        cov = numpy.random.normal(size=self.shape + (3, 3))
        cov = numpy.matmul(
            cov, numpy.rollaxis(cov, -1, -2)).astype(numpy.float32)
        scale_tril = numpy.linalg.cholesky(cov).astype(numpy.float32)
        self.params = {"loc": loc, "scale_tril": scale_tril}
        self.scipy_params = {"mean": loc, "cov": cov}
<commit_msg>[change] test to new style<commit_after>from chainer import distributions
from chainer import testing
import numpy


@testing.parameterize(*testing.product({
    'shape': [(3, 2), (1,)],
    'is_variable': [True, False],
    'sample_shape': [(3, 2), ()],
}))
@testing.fix_random()
@testing.with_requires('scipy')
class TestMultivariateNormal(testing.distribution_unittest):

    scipy_onebyone = True

    def setUp_configure(self):
        from scipy import stats
        self.dist = distributions.MultivariateNormal
        self.scipy_dist = stats.multivariate_normal
        self.scipy_onebyone = True
        self.event_shape = (3,)

        self.test_targets = set([
            "batch_shape", "entropy", "event_shape", "log_prob",
            "support"])

        loc = numpy.random.uniform(
            -1, 1, self.shape + (3,)).astype(numpy.float32)
        cov = numpy.random.normal(size=self.shape + (3, 3))
        cov = numpy.matmul(
            cov, numpy.rollaxis(cov, -1, -2)).astype(numpy.float32)
        scale_tril = numpy.linalg.cholesky(cov).astype(numpy.float32)
        self.params = {"loc": loc, "scale_tril": scale_tril}
        self.scipy_params = {"mean": loc, "cov": cov}

{'fraction_non_alphanumeric': 0.14432989690721648, 'fraction_numerical': 0.015670103092783504, 'mean_word_length': 3.0165562913907285, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3403287', 'n_tokens_mistral': 841, 'n_tokens_neox': 791, 'n_words': 157}