Skip to content

Commit

Permalink
Remove useless code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mansterteddy committed Jun 30, 2022
1 parent 13bbefa commit 0a82548
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 414 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.onnx
*.txt
*.bin
*.dll
*.dll
.vscode
26 changes: 26 additions & 0 deletions onnxruntime/trace/test_input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import io
import onnx
import unittest
import platform
import torchvision
import numpy as np
from onnxruntime_extensions import PyOrtFunction, hook_model_op, PyOp
from onnxruntime_extensions.onnxprocess import torch_wrapper as torch
from onnxruntime_extensions.onnxprocess import trace_for_onnx, pyfunc_from_model

input_text = ['test sentence', 'sentence 2']
f = io.BytesIO()

with trace_for_onnx(input_text, names=['in_text']) as tc_sess:
tc_inputs = tc_sess.get_inputs()[0]
print(tc_inputs)
batchsize = tc_inputs.size()[0]
shape = [batchsize, 2]
fuse_output = torch.zeros(*shape).size()
tc_sess.save_as_onnx(f, fuse_output)

m = onnx.load_model_from_string(f.getvalue())
onnx.save_model(m, 'temp_test00.onnx')
fu_m = PyOrtFunction.from_model(m)
result = fu_m(input_text)
print(result)
143 changes: 0 additions & 143 deletions pytorch/NLP/Blocks/blocks.py

This file was deleted.

33 changes: 0 additions & 33 deletions pytorch/NLP/Sequence/seq.py

This file was deleted.

118 changes: 0 additions & 118 deletions pytorch/NLP/Tensor/tensor.py

This file was deleted.

33 changes: 0 additions & 33 deletions pytorch/NLP/WordEmbeddings/cbow.py

This file was deleted.

Loading

0 comments on commit 0a82548

Please sign in to comment.