Hi,
Is it possible to get the model summary described in this link

  
    
    
    Is there similar pytorch function as model.summary() as keras? 
  
  
    Yes, you can get exact Keras representation, using this code. 
Example for VGG16
from torchvision import models
from summary import summary

vgg = models.vgg16()
summary(vgg, (3, 224, 224))

----------------------------------------------------------------
        Layer (type)               Output Shpae         Param #
================================================================
            Conv2d-1         [-1, 64, 224, 224]            1792
              ReLU-2         [-1, 64, 224, 224]    …
  


, but for cpp jit model?
This is an enhancement for printing the model in this link;

  
    
    
    Print network architecture in cpp jit jit
  
  
    We don’t have any built-in utils for this, but you can do a simple version manually: 
#include <torch/script.h>

#include <iostream>
#include <memory>

void tabs(size_t num) {
  for (size_t i = 0; i < num; i++) {
    std::cout << "\t";
  }
}

void print_modules(const torch::jit::script::Module& module, size_t level = 0) {
  std::cout << module.name().qualifiedName() << " (\n";
  for (const auto& module : module.get_modules()) {
    tabs(level + 1);
    print_modules(module.module, level + 1);
  …
  


Thanks.
rgds,
CL