def test_interface(self): mySymbolicMatricesList = TypedListType(T.TensorType(theano.config.floatX, (False, False)))() myMatrix = T.matrix() myScalar = T.scalar(dtype="int64") z = mySymbolicMatricesList.insert(myScalar, myMatrix) f = theano.function([mySymbolicMatricesList, myScalar, myMatrix], z) x = rand_ranged_matrix(-1000, 1000, [100, 101]) y = rand_ranged_matrix(-1000, 1000, [100, 101]) self.assertTrue(numpy.array_equal(f([x], numpy.asarray(1, dtype="int64"), y), [x, y]))
def test_interface(self): mySymbolicMatricesList = TypedListType( T.TensorType(theano.config.floatX, (False, False)))() myMatrix = T.matrix() myScalar = T.scalar(dtype="int64") z = mySymbolicMatricesList.insert(myScalar, myMatrix) f = theano.function([mySymbolicMatricesList, myScalar, myMatrix], z) x = rand_ranged_matrix(-1000, 1000, [100, 101]) y = rand_ranged_matrix(-1000, 1000, [100, 101]) assert np.array_equal(f([x], np.asarray(1, dtype="int64"), y), [x, y])