testInitializedValue :: Test
testInitializedValue =
    testCase "testInitializedValue" $ runSession $ do
        initialized <- initializedVariable (Ops.constant [1] [42 :: Float])
        result <- run (initializedValue initialized)
        liftIO $ Just [42] @=? (result :: Maybe (V.Vector Float))

        uninitialized <- variable [1]
        -- Can't use @=? because there is no Show instance for Tensor.
        when (isJust (initializedValue (uninitialized :: Variable Float))) $
            liftIO $ assertFailure "initializedValue should be Nothing, got Just"
testInitializedValue :: Test
testInitializedValue =
    testCase "testInitializedValue" $ runSession $ do
        initialized <- initializedVariable (Ops.constant [1] [42 :: Float])
        result <- run (initializedValue initialized)
        liftIO $ Just [42] @=? (result :: Maybe (V.Vector Float))

        uninitialized <- variable [1]
        -- Can't use @=? because there is no Show instance for Tensor.
        when (isJust (initializedValue (uninitialized :: Variable Float))) $
            liftIO $ assertFailure "initializedValue should be Nothing, got Just"
testInitializedValue =
    testCase "testInitializedValue" $ runSession $ do
        initialized <- initializedVariable (Ops.constant [1] [42 :: Float])
        result <- run (initializedValue initialized)
        liftIO $ Just [42] @=? (result :: Maybe (V.Vector Float))

        uninitialized <- variable [1]
        -- Can't use @=? because there is no Show instance for Tensor.
        when (isJust (initializedValue (uninitialized :: Variable Float))) $
            liftIO $ assertFailure "initializedValue should be Nothing, got Just"