1
0
Fork 0
mirror of https://github.com/tensorflow/haskell.git synced 2024-11-26 21:09:44 +01:00

Add TensorFlow.Core module to start formalizing the exposed API (#17)

* Add TensorFlow.Core module to start formalizing the exposed API

* Refer to ops packages instead of modules
This commit is contained in:
fkm3 2016-11-10 09:47:41 -08:00 committed by Judah Jacobson
parent 9e005e3af7
commit 630850c2d2
3 changed files with 95 additions and 2 deletions

View file

@ -0,0 +1,92 @@
-- Copyright 2016 TensorFlow authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
{-# LANGUAGE ExplicitNamespaces #-}
-- | The core functionality of TensorFlow.
--
-- Unless you are defining ops, you do not need to import other modules from
-- this package.
--
-- Basic ops are provided in the tensorflow-ops and tensorflow-core-ops
-- packages.
module TensorFlow.Core
( -- * Session
Session
, SessionOption
, sessionConfig
, sessionTarget
, runSession
, runSessionWithOptions
-- ** Building graphs
, build
, buildAnd
, buildWithSummary
-- ** Running graphs
, Fetchable
, Scalar(..)
, Nodes
, run
, run_
, Feed
, feed
, runWithFeeds
, runWithFeeds_
-- ** Async
, asyncProdNodes
-- * Build
, Build
, BuildT
, render
, asGraphDef
, addGraphDef
-- * Tensor
, ControlNode
, Tensor
, Value
, Ref
, TensorKind(..)
, tensorAttr
, value
, tensorFromName
-- ** Element types
, TensorData
, TensorType(decodeTensorData, encodeTensorData)
, Shape(..)
, OneOf
, type (/=)
-- * Op combinators
, colocateWith
, Device(..)
, withDevice
, withNameScope
, named
-- ** Dependencies
, withControlDependencies
, group
-- ** Misc
, identity
, noOp
) where
import TensorFlow.Build
import TensorFlow.ControlFlow
import TensorFlow.Nodes
import TensorFlow.Output
import TensorFlow.Session
import TensorFlow.Tensor
import TensorFlow.Types

View file

@ -19,7 +19,6 @@
module TensorFlow.Session ( module TensorFlow.Session (
Session, Session,
-- * Opaque value created via 'sessionConfig' and 'sessionTarget'.
SessionOption, SessionOption,
sessionConfig, sessionConfig,
sessionTarget, sessionTarget,
@ -76,6 +75,7 @@ runSession :: Session a -> IO a
runSession = runSessionWithOptions [] runSession = runSessionWithOptions []
-- | Setting of an option for the session (see 'runSessionWithOptions'). -- | Setting of an option for the session (see 'runSessionWithOptions').
-- Opaque value created via 'sessionConfig' and 'sessionTarget'.
newtype SessionOption = newtype SessionOption =
SessionOption { unSesssionOption :: Raw.SessionOptions -> IO () } SessionOption { unSesssionOption :: Raw.SessionOptions -> IO () }

View file

@ -16,13 +16,14 @@ library
exposed-modules: TensorFlow.Build exposed-modules: TensorFlow.Build
, TensorFlow.BuildOp , TensorFlow.BuildOp
, TensorFlow.ControlFlow , TensorFlow.ControlFlow
, TensorFlow.Core
, TensorFlow.Internal.FFI , TensorFlow.Internal.FFI
, TensorFlow.Internal.VarInt
, TensorFlow.Nodes , TensorFlow.Nodes
, TensorFlow.Output , TensorFlow.Output
, TensorFlow.Session , TensorFlow.Session
, TensorFlow.Tensor , TensorFlow.Tensor
, TensorFlow.Types , TensorFlow.Types
, TensorFlow.Internal.VarInt
other-modules: TensorFlow.Internal.Raw other-modules: TensorFlow.Internal.Raw
, TensorFlow.Orphans , TensorFlow.Orphans
build-tools: c2hs build-tools: c2hs