from chainer import function


class Reshape(function.Function):

    """Reshapes an input array without copy."""

    def __init__(self, shape):
        self.shape = shape

    def forward(self, x):
        return x[0].reshape(self.shape),

    def backward(self, x, gy):
        return gy[0].reshape(x[0].shape),


def reshape(x, shape):
    """Reshapes an input variable without copy.

    Args:
        x (~chainer.Variable): Input variable.
        shape (tuple of ints): Target shape.

    Returns:
        ~chainer.Variable: Variable that holds a reshaped version of the input
            variable.

    """
    return Reshape(shape)(x)

@@ -1,8 +1,22 @@
+import numpy%0A%0A
 from cha
@@ -36,16 +36,53 @@
 unction%0A
+from chainer.utils import type_check%0A
 %0A%0Aclass 
@@ -186,24 +186,24 @@
 lf, shape):%0A
-
         self
@@ -218,16 +218,837 @@
  shape%0A%0A
+    def check_type_forward(self, in_type):%0A        type_check.expect(in_type.size() == 1)%0A        x_type, = in_type%0A%0A        in_shape_size = type_check.Variable(%0A            numpy.prod(x_type.shape.eval()), 'in_shape_size')%0A        out_shape_size = type_check.Variable(%0A            numpy.prod(self.shape), 'out_shape_size')%0A        type_check.expect(in_shape_size == out_shape_size)%0A%0A    def check_type_backward(self, in_types, out_types):%0A        type_check.expect(out_types.size() == 1)%0A        x_type, = in_types%0A        y_type, = out_types%0A%0A        in_shape_size = type_check.Variable(%0A            numpy.prod(x_type.shape.eval()), 'in_shape_size')%0A        out_shape_size = type_check.Variable(%0A            numpy.prod(y_type.shape.eval()), 'out_shape_size')%0A        type_check.expect(in_shape_size == out_shape_size)%0A%0A
     def 

Add typecheck for Reshape function