testResizeBilinearGrad :: Test
testResizeBilinearGrad = testCase "testResizeBilinearGrad" $ do
    (dx, shapeDX, shapeX) <- TF.runSession $ do
        let shape = TF.vector [1, 2, 2, 1 :: Int32]
        x <- TF.render $ TF.fill shape (TF.scalar (1 :: Float))
        let outSize = TF.vector [4, 4 :: Int32]
            align = TF.opAttr "align_corners" .~ True
            y = TF.resizeBilinear' align x outSize

        [dx] <- TF.gradients y [x]
        TF.run (dx, TF.shape dx, TF.shape x)
    shapeX @=? (shapeDX :: V.Vector Int32)
    let expect = V.fromList [4, 4, 4, 4 :: Float]
        near = 0.00001 > (V.sum $ V.zipWith (-) expect (dx :: V.Vector Float))
    near @=? True
testResizeBilinearGrad :: Test
testResizeBilinearGrad = testCase "testResizeBilinearGrad" $ do
    (dx, shapeDX, shapeX) <- TF.runSession $ do
        let shape = TF.vector [1, 2, 2, 1 :: Int32]
        x <- TF.render $ TF.fill shape (TF.scalar (1 :: Float))
        let outSize = TF.vector [4, 4 :: Int32]
            align = TF.opAttr "align_corners" .~ True
            y = TF.resizeBilinear' align x outSize

        [dx] <- TF.gradients y [x]
        TF.run (dx, TF.shape dx, TF.shape x)
    shapeX @=? (shapeDX :: V.Vector Int32)
    let expect = V.fromList [4, 4, 4, 4 :: Float]
        near = 0.00001 > (V.sum $ V.zipWith (-) expect (dx :: V.Vector Float))
    near @=? True
testResizeBilinearGrad = testCase "testResizeBilinearGrad" $ do
    (dx, shapeDX, shapeX) <- TF.runSession $ do
        let shape = TF.vector [1, 2, 2, 1 :: Int32]
        x <- TF.render $ TF.fill shape (TF.scalar (1 :: Float))
        let outSize = TF.vector [4, 4 :: Int32]
            align = TF.opAttr "align_corners" .~ True
            y = TF.resizeBilinear' align x outSize

        [dx] <- TF.gradients y [x]
        TF.run (dx, TF.shape dx, TF.shape x)
    shapeX @=? (shapeDX :: V.Vector Int32)
    let expect = V.fromList [4, 4, 4, 4 :: Float]
        near = 0.00001 > (V.sum $ V.zipWith (-) expect (dx :: V.Vector Float))
    near @=? True