Docs for compilable.py
@@ -127,35 +127,69 @@ class ICompilable(metaclass=AutoBuild):
@abc.abstractproperty
def initializables(self):
"""
+ List of TensorFlow tensors which must be initialized.
+ This list is necessary for successfull _initialize_ call.
+ :return: List of TensorFlow variables, data iterators or both,
+ which are capable to be initialized.
+
"""
raise NotImplementedError()
@abc.abstractproperty
def initializable_feeds(self):
"""
+ Feed dictionary which will be used along with `initializables` list
+ at `initialize` function.
+ :return: Standard TensorFlow feed dictionary which must be used at
+ at initialization.
"""
raise NotImplementedError()
@abc.abstractmethod
- def build(self):
+ def initialize(self, session=None, force=False):
+ """
+ This method initializes all TensorFlow tensors listed by `initializables`
+ property with the aid of feed dictionary presented by `initializable_feeds`.
+ """
raise NotImplementedError()
@abc.abstractmethod
- def initialize(self, session=None, force=False):
+ def build(self):
+ """
+ Public method for building tensors defined by ICompilable object at default
+ TensorFlow graph. Wrapper for internal `_build` method.
+ """
raise NotImplementedError()
@abc.abstractmethod
def compile(self, session=None):
+ """
+ Two-phase method. At first it builds tensors and then initializes them at
+ for a specific session session.
+ :param session: TensorFlow session.
+ """
raise NotImplementedError()
@abc.abstractmethod
def is_built(self, graph):
+ """
+ Checks if tensors belonging to this ICompilable object were built for
+ the _graph_ argument.
+ :param graph: TensorFlow graph.
+ :return: _Build_ status.
+ """
raise NotImplementedError()
@abc.abstractmethod
def clear(self):
+ """
+ Clears out tensors from ICompilable object and removes all ties with them.
+ """
raise NotImplementedError()
@abc.abstractmethod
def _build(self):
+ """
+ Internal build function. Designed for creating tensors which ICompilable object holds.
+ """
raise NotImplementedError()
