This message was deleted.
# announcements
s
This message was deleted.
a
for a tensorflow model to work, users have to explicitly define the signature of the model with the decorator
@tf.function
. Usually, inference function that is used by default by tensorflow is
__call__
: (an toy example)
Copy code
class NativeModel(tf.Module):
    def __init__(self):
        super().__init__()
        self.weights = np.asfarray([[1.0], [1.0], [1.0], [1.0], [1.0]])
        self.dense = lambda inputs: tf.matmul(inputs, self.weights)

    @tf.function(
        input_signature=[tf.TensorSpec(shape=[1, 5], dtype=tf.float64, name="inputs")]
    )
    def __call__(self, inputs):
        return self.dense(inputs)
redirect this to #support
I believe that this https://www.tensorflow.org/guide/function from Tensorflow goes into how the decorator works. a lot more thoroughly. Let me know if you still need any help