Example (optimizing a module with Conv->Batchnorm):
  import torch
  in_channels, out_channels = 3, 32
  conv = torch.nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=2, bias=True)
  bn = torch.nn.BatchNorm2d(out_channels, eps=.001)
  mod = torch.nn.Sequential(conv, bn)
  frozen_mod = torch.jit.optimize_for_inference(torch.jit.script(mod.eval()))
  assert "batch_norm" not in str(frozen_mod.graph)
  # if built with MKLDNN, convolution will be run with MKLDNN weights
  assert "MKLDNN" in frozen_mod.graph

Return type:
      ScriptModule