1
0
Fork 0
mirror of https://github.com/tensorflow/haskell.git synced 2024-11-30 06:49:44 +01:00

Replaced topK with topKV2. (#21)

topK is obsolete and generating warnings.
This commit is contained in:
Greg Steuck 2016-11-08 20:57:22 -08:00 committed by fkm3
parent 8db944578a
commit 4ec78a8fca
3 changed files with 4 additions and 2 deletions

View file

@ -95,7 +95,6 @@ module TensorFlow.Ops
, CoreOps.sparseToDense , CoreOps.sparseToDense
, CoreOps.sub , CoreOps.sub
, CoreOps.sum , CoreOps.sum
, CoreOps.topK
, CoreOps.transpose , CoreOps.transpose
, truncatedNormal , truncatedNormal
, variable , variable

View file

@ -160,6 +160,7 @@ Test-Suite MiscTest
, google-shim , google-shim
, transformers , transformers
, tensorflow , tensorflow
, tensorflow-core-ops
, tensorflow-ops , tensorflow-ops
, tensorflow-proto , tensorflow-proto
, test-framework , test-framework

View file

@ -23,6 +23,7 @@ import Test.Framework.Providers.HUnit (testCase)
import Test.HUnit ((@=?)) import Test.HUnit ((@=?))
import Google.Test import Google.Test
import qualified Data.Vector as V import qualified Data.Vector as V
import qualified TensorFlow.GenOps.Core as CoreOps
import TensorFlow.Ops import TensorFlow.Ops
import TensorFlow.Session import TensorFlow.Session
@ -30,7 +31,8 @@ import TensorFlow.Session
-- | Test fetching multiple outputs from an op. -- | Test fetching multiple outputs from an op.
testMultipleOutputs = testCase "testMultipleOutputs" $ testMultipleOutputs = testCase "testMultipleOutputs" $
runSession $ do runSession $ do
(values, indices) <- run $ topK 2 $ constant [1, 4] [10, 40, 20, 30] (values, indices) <-
run $ CoreOps.topKV2 (constant [1, 4] [10, 40, 20, 30]) 2
liftIO $ [40, 30] @=? V.toList (values :: V.Vector Float) liftIO $ [40, 30] @=? V.toList (values :: V.Vector Float)
liftIO $ [1, 3] @=? V.toList (indices :: V.Vector Int32) liftIO $ [1, 3] @=? V.toList (indices :: V.Vector Int32)