Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ricky40403 committed Oct 19, 2019
1 parent c466ef3 commit a703072
Show file tree
Hide file tree
Showing 16 changed files with 1,874 additions and 2,904 deletions.
Binary file modified examples/alexnet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/densenet161.png
Binary file not shown.
2,477 changes: 0 additions & 2,477 deletions examples/example.ipynb

This file was deleted.

Binary file modified examples/googlenet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/inception_v3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/mobilenet_v2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/resnet18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/shufflenet_v2_x1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/squeezenet1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/vgg16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
532 changes: 532 additions & 0 deletions summary_example.ipynb

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
import torchvision.models as models
import copy
from transformers.torchTransformer import TorchTransformer
# from quantize import QConv2d
model = models.__dict__["inception_v3"]()
# model.cuda()
from transformers.quantize import QConv2d
model = models.__dict__["resnet18"]()
model.cuda()
model = model.eval()

transofrmer = TorchTransformer()
transofrmer.register(nn.Conv2d, QConv2d)
model = transofrmer.trans_layers(model)
print(model)
sys.exit()


input_tensor = torch.randn([1, 3, 224, 224])
# input_tensor = input_tensor.cuda()
input_tensor = input_tensor.cuda()
net = transofrmer.summary(model, input_tensor=input_tensor)
# transofrmer.visualize(model, save_name= "example", graph_size = 80)
# transofrmer.visualize(model, input_tensor = input_tensor, save_name= "example", graph_size = 80)
362 changes: 362 additions & 0 deletions transform_example.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit a703072

Please sign in to comment.