<commit_before>import unittest

import numpy

import chainer
from chainer import cuda
from chainer import gradient_check
from chainer import initializers
from chainer.links import deconvolution_nd
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.testing import parameterize
from chainer.utils import conv


@parameterize(*testing.product({
    'dims': [(5, 4, 3), (4, 3), (3,)],
    'nobias': [True, False],
    'dtype': [numpy.float32],   # TODO(takagi) other dtypes.
    'use_cudnn': [True, False],
    'used_outsize': ['case1', 'case2', 'None'],
}))
class TestDeconvolutionND(unittest.TestCase):

    def setUp(self):
        N = 2
        in_channels = 3
        out_channels = 2
        ndim = len(self.dims)
        ksize = (3,) * ndim
        stride = (2,) * ndim
        pad = (1,) * ndim

        if self.used_outsize == 'case1' or self.used_outsize == 'None':
            # Use output size determined with get_deconv_outsize.
            outs = tuple(
                conv.get_deconv_outsize(d, k, s, p)
                for (d, k, s, p) in zip(self.dims, ksize, stride, pad))
        elif self.used_outsize == 'case2':
            # Use possible output size other than the one determined with
            # get_deconv_outsize.
            outs = tuple(
                conv.get_deconv_outsize(d, k, s, p) + 1<commit_msg>Add FP16 and FP64 to test parameter.<commit_after>import unittest

import numpy

import chainer
from chainer import cuda
from chainer import gradient_check
from chainer import initializers
from chainer.links import deconvolution_nd
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.testing import parameterize
from chainer.utils import conv


@parameterize(*testing.product({
    'dims': [(5, 4, 3), (4, 3), (3,)],
    'nobias': [True, False],
    'dtype': [numpy.float16, numpy.float32, numpy.float64],
    'use_cudnn': [True, False],
    'used_outsize': ['case1', 'case2', 'None'],
}))
class TestDeconvolutionND(unittest.TestCase):

    def setUp(self):
        N = 2
        in_channels = 3
        out_channels = 2
        ndim = len(self.dims)
        ksize = (3,) * ndim
        stride = (2,) * ndim
        pad = (1,) * ndim

        if self.used_outsize == 'case1' or self.used_outsize == 'None':
            # Use output size determined with get_deconv_outsize.
            outs = tuple(
                conv.get_deconv_outsize(d, k, s, p)
                for (d, k, s, p) in zip(self.dims, ksize, stride, pad))
        elif self.used_outsize == 'case2':
            # Use possible output size other than the one determined with
            # get_deconv_outsize.
            outs = tuple(
                conv.get_deconv_outsize(d, k, s, p) + 1
{'fraction_non_alphanumeric': 0.11004273504273504, 'fraction_numerical': 0.01638176638176638, 'mean_word_length': 2.624516129032258, 'pattern_counts': {'":': 0, '<': 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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4672159', 'n_tokens_mistral': 921, 'n_tokens_neox': 880, 'n_words': 274}