1
0
Fork 0
mirror of https://github.com/tensorflow/haskell.git synced 2024-11-26 21:09: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.sub
, CoreOps.sum
, CoreOps.topK
, CoreOps.transpose
, truncatedNormal
, variable

View file

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

View file

@ -23,6 +23,7 @@ import Test.Framework.Providers.HUnit (testCase)
import Test.HUnit ((@=?))
import Google.Test
import qualified Data.Vector as V
import qualified TensorFlow.GenOps.Core as CoreOps
import TensorFlow.Ops
import TensorFlow.Session
@ -30,7 +31,8 @@ import TensorFlow.Session
-- | Test fetching multiple outputs from an op.
testMultipleOutputs = testCase "testMultipleOutputs" $
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 $ [1, 3] @=? V.toList (indices :: V.Vector Int32)