示例#1
0
    def test_reprArray(self, numPoints=200):
        def evalArray(arrRepr):
            from numpy import array, zeros, dtype
            return eval(arrRepr)

        for _ in range(numPoints):
            shape = shapeRand(ranks=[0, 1, 2, 3])
            arr = randn(*shape)
            arrRepr = mathhelp.reprArray(arr)
            arrAgain = evalArray(arrRepr)
            assert_allclose(arrAgain, arr)
示例#2
0
    def test_reprArray(self, numPoints = 200):
        def evalArray(arrRepr):
            from numpy import array, zeros, dtype
            return eval(arrRepr)

        for _ in range(numPoints):
            shape = shapeRand(ranks = [0, 1, 2, 3])
            arr = randn(*shape)
            arrRepr = mathhelp.reprArray(arr)
            arrAgain = evalArray(arrRepr)
            assert_allclose(arrAgain, arr)
示例#3
0
 def __repr__(self):
     return 'LinearTransform(%s, tag=%r)' % (reprArray(self.mat), self.tag)