-
Notifications
You must be signed in to change notification settings - Fork 257
【社区实习】data2vec-vision #1618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【社区实习】data2vec-vision #1618
Conversation
/model data2vec |
1 similar comment
/model data2vec |
if is_mindspore_available(): | ||
import mindspore | ||
|
||
mindspore.set_context(pynative_synchronize=True) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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)`): |
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多余的注释要删掉,上下都有
全部通过的截图附上,RUN_SLOW必须跑 |
/model data2vec |
/model data2vec |
No description provided.