EADST

Check "bert-base-uncased" Model Structure

Check "bert-base-uncased" Model Structure

import torch
from transformers import BertModel
from torchinfo import summary

model = BertModel.from_pretrained("bert-base-uncased")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)

input_size = (1, 512)  # input size
input_tensor = torch.randint(0, 10000, input_size, dtype=torch.long, device=device)

summary(model, input_data=input_tensor)
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
站点统计

本站现有博文266篇,共被浏览440671

本站已经建立2019天!

热门文章
文章归档
回到顶部