testSpaceToBatchND :: Test
testSpaceToBatchND =
  testCase "testSpaceToBatchND" $ do
    ([dx], [s]) <-
      TF.runSession $ do
        (x :: TF.Tensor TF.Value Float) <- TF.render $ TF.constant (TF.Shape [1, 2, 2, 1 :: Int64]) [1, 2, 3, 4]
        shape  <- TF.render $ TF.vector [2, 2 :: Int32]
        paddings  <- TF.render $ TF.constant (TF.Shape [2, 2]) [0, 0, 0, 0 :: Int32]
        let y = TF.spaceToBatchND x shape paddings
        calculateGradWithShape y x
    V.fromList [1, 1, 1, 1] @=? dx
    V.fromList [1, 2, 2, 1] @=? s
testSpaceToBatchND :: Test
testSpaceToBatchND =
  testCase "testSpaceToBatchND" $ do
    ([dx], [s]) <-
      TF.runSession $ do
        (x :: TF.Tensor TF.Value Float) <- TF.render $ TF.constant (TF.Shape [1, 2, 2, 1 :: Int64]) [1, 2, 3, 4]
        shape  <- TF.render $ TF.vector [2, 2 :: Int32]
        paddings  <- TF.render $ TF.constant (TF.Shape [2, 2]) [0, 0, 0, 0 :: Int32]
        let y = TF.spaceToBatchND x shape paddings
        calculateGradWithShape y x
    V.fromList [1, 1, 1, 1] @=? dx
    V.fromList [1, 2, 2, 1] @=? s
testSpaceToBatchND =
  testCase "testSpaceToBatchND" $ do
    ([dx], [s]) <-
      TF.runSession $ do
        (x :: TF.Tensor TF.Value Float) <- TF.render $ TF.constant (TF.Shape [1, 2, 2, 1 :: Int64]) [1, 2, 3, 4]
        shape  <- TF.render $ TF.vector [2, 2 :: Int32]
        paddings  <- TF.render $ TF.constant (TF.Shape [2, 2]) [0, 0, 0, 0 :: Int32]
        let y = TF.spaceToBatchND x shape paddings
        calculateGradWithShape y x
    V.fromList [1, 1, 1, 1] @=? dx
    V.fromList [1, 2, 2, 1] @=? s