def layer(func):
def layer_decorated(self):
print('func is wrapped');
func(self)
return self
return layer_decorated
class Network(object):
data = 0
def __init__(self):
self.data = 1024
# conv = layer(conv)와 같은 의미
@layer
def conv(self):
print('conv is called')
No comments:
Post a Comment