What is the equivalent of `tf. make_template` in tensorflow 2.0?

Viewed 107

I want to define a function in init function which is like code below in tf1.x

class someclass():
   def __init__(self, args...):
       def f(x, args...):
           # some NN layers
           # pass x to NN layer
           # get some results
           return something
       self.template = tf.make_template(self.__class__.__name__, f)
   def somefuc():
       # i can use f here

   def anotherfunc():
       # and f here

What is the equivalent way of it in tensorflow 2.0?

Or how to code a reuseable(parameters sharing) module for reuse in other layer?

0 Answers
Related