Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Display
Layout
Split
Unified
Real-time editor
Hide whitespace changes
Hide unchanged lines
Disable line wrap
Diff precision
Smart
Syntax
None
Change appearance
Process
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
ViTAttention
Created
5 years ago
Diff never expires
Clear
Export
Share
Explain
4 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
26 lines
Copy
0 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
26 lines
Copy
Copy
Copied
Copy
Copied
class TFViT
MAE
Attention(tf.keras.layers.Layer):
class TFViT
Attention(tf.keras.layers.Layer):
def __init__(self, config: ViT
MAE
Config, **kwargs):
def __init__(self, config: ViT
Config, **kwargs):
super().__init__(**kwargs)
super().__init__(**kwargs)
Copy
Copied
Copy
Copied
self.self_attention = TFViT
MAE
SelfAttention(config, name="attention")
self.self_attention = TFViT
SelfAttention(config, name="attention")
self.dense_output = TFViT
MAE
SelfOutput(config, name="output")
self.dense_output = TFViT
SelfOutput(config, name="output")
def prune_heads(self, heads):
def prune_heads(self, heads):
raise NotImplementedError
raise NotImplementedError
def call(
def call(
self,
self,
input_tensor: tf.Tensor,
input_tensor: tf.Tensor,
head_mask: tf.Tensor,
head_mask: tf.Tensor,
output_attentions: bool,
output_attentions: bool,
training: bool = False,
training: bool = False,
) -> Tuple[tf.Tensor]:
) -> Tuple[tf.Tensor]:
self_outputs = self.self_attention(
self_outputs = self.self_attention(
hidden_states=input_tensor, head_mask=head_mask, output_attentions=output_attentions, training=training
hidden_states=input_tensor, head_mask=head_mask, output_attentions=output_attentions, training=training
)
)
attention_output = self.dense_output(
attention_output = self.dense_output(
hidden_states=self_outputs[0], input_tensor=input_tensor, training=training
hidden_states=self_outputs[0], input_tensor=input_tensor, training=training
)
)
outputs = (attention_output,) + self_outputs[1:] # add attentions if we output them
outputs = (attention_output,) + self_outputs[1:] # add attentions if we output them
return outputs
return outputs
Saved diffs
Original text
Open file
class TFViTMAEAttention(tf.keras.layers.Layer): def __init__(self, config: ViTMAEConfig, **kwargs): super().__init__(**kwargs) self.self_attention = TFViTMAESelfAttention(config, name="attention") self.dense_output = TFViTMAESelfOutput(config, name="output") def prune_heads(self, heads): raise NotImplementedError def call( self, input_tensor: tf.Tensor, head_mask: tf.Tensor, output_attentions: bool, training: bool = False, ) -> Tuple[tf.Tensor]: self_outputs = self.self_attention( hidden_states=input_tensor, head_mask=head_mask, output_attentions=output_attentions, training=training ) attention_output = self.dense_output( hidden_states=self_outputs[0], input_tensor=input_tensor, training=training ) outputs = (attention_output,) + self_outputs[1:] # add attentions if we output them return outputs
Changed text
Open file
class TFViTAttention(tf.keras.layers.Layer): def __init__(self, config: ViTConfig, **kwargs): super().__init__(**kwargs) self.self_attention = TFViTSelfAttention(config, name="attention") self.dense_output = TFViTSelfOutput(config, name="output") def prune_heads(self, heads): raise NotImplementedError def call( self, input_tensor: tf.Tensor, head_mask: tf.Tensor, output_attentions: bool, training: bool = False, ) -> Tuple[tf.Tensor]: self_outputs = self.self_attention( hidden_states=input_tensor, head_mask=head_mask, output_attentions=output_attentions, training=training ) attention_output = self.dense_output( hidden_states=self_outputs[0], input_tensor=input_tensor, training=training ) outputs = (attention_output,) + self_outputs[1:] # add attentions if we output them return outputs
Find difference