Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@
*.npz
*.pyc
*~

.DS_Store
.idea
.spyproject/
.pytest_cache/

venv/
build/
dist
data/
dist/
docs/_build
tensorlayer.egg-info
tensorlayer/__pacache__
venv/
.pytest_cache/
tensorlayer/__pycache__

update_tl.bat
update_tl.py
10 changes: 9 additions & 1 deletion tensorlayer/layers/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-

import six
import time
from abc import ABCMeta, abstractmethod

import numpy as np
import tensorflow as tf
Expand Down Expand Up @@ -38,10 +40,16 @@
]


class LayersConfig:
@six.add_metaclass(ABCMeta)
class LayersConfig(object):

tf_dtype = tf.float32 # TensorFlow DType
set_keep = {} # A dictionary for holding tf.placeholders

@abstractmethod
def __init__(self):
pass


try: # For TF12 and later
TF_GRAPHKEYS_VARIABLES = tf.GraphKeys.GLOBAL_VARIABLES
Expand Down
10 changes: 10 additions & 0 deletions tests/test_layers_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
import tensorlayer as tl


class Core_Helpers_Test(unittest.TestCase):

def test_LayersConfig(self):
with self.assertRaises(TypeError):
tl.layers.LayersConfig()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Issue is not an issue ... It's a unittest !


self.assertIsInstance(tl.layers.LayersConfig.tf_dtype, tf.DType)
self.assertIsInstance(tl.layers.LayersConfig.set_keep, dict)


class Layer_Core_Test(unittest.TestCase):

@classmethod
Expand Down