Skip to content

Conversation

LuMH1027
Copy link
Contributor

No description provided.

@LuMH1027
Copy link
Contributor Author

@LuMH1027
Copy link
Contributor Author

LuMH1027 commented Sep 2, 2024

/model data2vec

1 similar comment
@LuMH1027
Copy link
Contributor Author

LuMH1027 commented Sep 3, 2024

/model data2vec

if is_mindspore_available():
import mindspore

mindspore.set_context(pynative_synchronize=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

正式代码不要开同步

from ...modeling_utils import PreTrainedModel
from ...ms_utils import find_pruneable_heads_and_indices, prune_linear_layer

# pylint: disable=E1102
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是disable了啥?写名字不写编号哈


context_layer = ops.matmul(attention_probs, value_layer)

context_layer = context_layer.permute(0, 2, 1, 3).contiguous()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.contiguous()删掉

Class for outputs of [`Data2VecVisionModel`].

Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

torch.XXTensor都改成mindspore.Tensor

batch_size, seq_len, _ = embeddings.shape

if bool_masked_pos is not None:
mask_tokens = self.mask_token.expand((batch_size, seq_len, -1))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expand要改,去看迁移教程

#ops.transpose((embeddings.flatten(start_dim=2)), 1,2)
embeddings = embeddings.flatten(start_dim=2).swapaxes(1, 2)

#embeddings = embeddings.flatten(start_dim=2).transpose(1, 2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多余的注释要删掉,上下都有

@lvyufeng
Copy link
Collaborator

lvyufeng commented Sep 5, 2024

全部通过的截图附上,RUN_SLOW必须跑

@LuMH1027
Copy link
Contributor Author

LuMH1027 commented Sep 5, 2024

ut全部通过
83abd53319db12f888c4e8294333458

@LuMH1027
Copy link
Contributor Author

/model data2vec

@LuMH1027
Copy link
Contributor Author

/model data2vec

@LuMH1027 LuMH1027 requested a review from lvyufeng September 11, 2024 09:45
@lvyufeng lvyufeng merged commit ae932d0 into mindspore-lab:master Sep 12, 2024
30 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants