This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from onnxruntime import InferenceSession | |
import torch | |
import torch.nn as nn | |
# Create simple model with one Gather node | |
model = nn.Embedding(num_embeddings=10, embedding_dim=5) | |
x = torch.randint(0, 10, (3,)) | |
torch.onnx.export( | |
model, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import numpy as np | |
from onnx import TensorProto, helper, save | |
from onnxruntime import InferenceSession | |
hidden_size = 10 | |
num_heads = 2 | |
head_size = 5 |