code: def linear(inp, output_dim, layer_name):
      with tf.variable_scope(layer_name):
          nx = shape_list(inp)[-1]
          if output_dim is None:
              output_dim = nx
          W = tf.get_variable(
              name="W",
              shape=[nx, output_dim],
              initializer=tf.initializers.glorot_normal(),
          )
          if inp.dtype == tf.float16:
              W = tf.cast(W, tf.float16)
  
          return tf.reshape(
              tf.matmul(
                  tf.reshape(inp, [-1, nx]),
                  tf.reshape(W, [nx, output_dim]),
              ),
              shape_list(inp)[:-1] + [output_dim],
          )
  
file_path: finetune/finetune/custom_ops/indico_tf_ops/python/dynamic_conv.py
imports: import os
  import math
  import numpy
  import tensorflow
  from finetune.util.shapes import shape_list
  from finetune.custom_ops.indico_tf_ops.python import indico_ops
label_desc: Use image node_id 1 for calling a global function with example usage: linear(inp, output_dim, layer_name) and returns: tf