testTile2DGrad :: Test
testTile2DGrad = testCase "testTileGrad2D" $ do
    (dx, shapeDX, shapeX) <- TF.runSession $ do
        let shape = TF.vector [3, 2 :: Int32]
        x <- TF.render $ TF.fill shape (TF.scalar (1::Float))
        let multiples = TF.vector [2, 3 :: Int32]
        let y = TF.tile x multiples

        [dx] <- TF.gradients y [x]
        TF.run (dx, TF.shape dx, TF.shape x)
    shapeX @=? (shapeDX :: V.Vector Int32)
    V.fromList [6, 6, 6, 6, 6, 6::Float] @=? (dx :: V.Vector Float)
testTile2DGrad :: Test
testTile2DGrad = testCase "testTileGrad2D" $ do
    (dx, shapeDX, shapeX) <- TF.runSession $ do
        let shape = TF.vector [3, 2 :: Int32]
        x <- TF.render $ TF.fill shape (TF.scalar (1::Float))
        let multiples = TF.vector [2, 3 :: Int32]
        let y = TF.tile x multiples

        [dx] <- TF.gradients y [x]
        TF.run (dx, TF.shape dx, TF.shape x)
    shapeX @=? (shapeDX :: V.Vector Int32)
    V.fromList [6, 6, 6, 6, 6, 6::Float] @=? (dx :: V.Vector Float)
testTile2DGrad = testCase "testTileGrad2D" $ do
    (dx, shapeDX, shapeX) <- TF.runSession $ do
        let shape = TF.vector [3, 2 :: Int32]
        x <- TF.render $ TF.fill shape (TF.scalar (1::Float))
        let multiples = TF.vector [2, 3 :: Int32]
        let y = TF.tile x multiples

        [dx] <- TF.gradients y [x]
        TF.run (dx, TF.shape dx, TF.shape x)
    shapeX @=? (shapeDX :: V.Vector Int32)
    V.fromList [6, 6, 6, 6, 6, 6::Float] @=? (dx :: V.Vector Float)