def __init__(self, config, **kwargs):
    super().__init__(**kwargs)
    if (config.num_groups == 1):
        self.dense = tf.keras.layers.Dense(config.intermediate_size, kernel_initializer=get_initializer(config.initializer_range), name='dense')
    else:
        self.dense = GroupedLinearLayer(config.hidden_size, config.intermediate_size, num_groups=config.num_groups, kernel_initializer=get_initializer(config.initializer_range), name='dense')
    if isinstance(config.hidden_act, str):
        self.intermediate_act_fn = get_tf_activation(config.hidden_act)
    else:
        self.intermediate_act_fn = config.hidden_act
def __init__(self, config, **kwargs):
    super().__init__(**kwargs)
    if (config.num_groups == 1):
        self.dense = tf.keras.layers.Dense(config.intermediate_size, kernel_initializer=get_initializer(config.initializer_range), name='dense')
    else:
        self.dense = GroupedLinearLayer(config.hidden_size, config.intermediate_size, num_groups=config.num_groups, kernel_initializer=get_initializer(config.initializer_range), name='dense')
    if isinstance(config.hidden_act, str):
        self.intermediate_act_fn = get_tf_activation(config.hidden_act)
    else:
        self.intermediate_act_fn = config.hidden_act