Sunday, September 6, 2020

use case of decorator function in python

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

Task in UnrealEngine

 https://www.youtube.com/watch?v=1lBadANnJaw