Skip to content

Commit

Permalink
change tf.math.divide with int(/) to remove dim_per_head from the TF …
Browse files Browse the repository at this point in the history
…graph (#14600)

Co-authored-by: yis <yis@graphcore.ai>
  • Loading branch information
yis11178 and yis11178 authored Dec 2, 2021
1 parent 43f953c commit 96cc02b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def call(self, query, key, value, mask, head_mask, output_attentions, training=F
k_length = shape_list(key)[1]
# assert dim == self.dim, f'Dimensions do not match: {dim} input vs {self.dim} configured'
# assert key.size() == value.size()
dim_per_head = tf.math.divide(self.dim, self.n_heads)
dim_per_head = int(self.dim / self.n_heads)
dim_per_head = tf.cast(dim_per_head, dtype=tf.int32)
mask_reshape = [bs, 1, 1, k_length]

Expand Down

0 comments on commit 96cc02b

Please sign in to comment.