From 4ec78a8fca72f78b11740ca38d0ab1186849648d Mon Sep 17 00:00:00 2001 From: Greg Steuck Date: Tue, 8 Nov 2016 20:57:22 -0800 Subject: [PATCH] Replaced topK with topKV2. (#21) topK is obsolete and generating warnings. --- tensorflow-ops/src/TensorFlow/Ops.hs | 1 - tensorflow-ops/tensorflow-ops.cabal | 1 + tensorflow-ops/tests/MiscTest.hs | 4 +++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tensorflow-ops/src/TensorFlow/Ops.hs b/tensorflow-ops/src/TensorFlow/Ops.hs index 3fff01d..9d124b0 100644 --- a/tensorflow-ops/src/TensorFlow/Ops.hs +++ b/tensorflow-ops/src/TensorFlow/Ops.hs @@ -95,7 +95,6 @@ module TensorFlow.Ops , CoreOps.sparseToDense , CoreOps.sub , CoreOps.sum - , CoreOps.topK , CoreOps.transpose , truncatedNormal , variable diff --git a/tensorflow-ops/tensorflow-ops.cabal b/tensorflow-ops/tensorflow-ops.cabal index ac34d4c..d819788 100644 --- a/tensorflow-ops/tensorflow-ops.cabal +++ b/tensorflow-ops/tensorflow-ops.cabal @@ -160,6 +160,7 @@ Test-Suite MiscTest , google-shim , transformers , tensorflow + , tensorflow-core-ops , tensorflow-ops , tensorflow-proto , test-framework diff --git a/tensorflow-ops/tests/MiscTest.hs b/tensorflow-ops/tests/MiscTest.hs index 5323191..47c7029 100644 --- a/tensorflow-ops/tests/MiscTest.hs +++ b/tensorflow-ops/tests/MiscTest.hs @@ -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)