How do I display computation graph in tensorboard from pytorch?

I logged my output images to tensorboard as follows:

```
import tensorflow as tf
self.tf = tf
self.writer = tf.summary.FileWriter('path/to/log/dir')
img_summaries = []
...
for label, image_numpy in visuals.items():
try:
s = StringIO()
except:
s = BytesIO()
scipy.misc.toimage(image_numpy).save(s, format="jpeg")
img_sum = self.tf.Summary.Image(encoded_image_string=s.getvalue(), height=image_numpy.shape[0], width=image_numpy.shape[1])
img_summaries.append(self.tf.Summary.Value(tag=label, image=img_sum))
summary = self.tf.Summary(value=img_summaries)
self.writer.add_summary(summary, step)
```

But when I try to add graph to tensorboard:

`writer.add_graph(model, loss_1)`

I get this error:

```
raise TypeError("The passed graph must be an instance of `Graph` "
TypeError: The passed graph must be an instance of `Graph` or the deprecated `GraphDef`
```

```
>>> print(torch.__version__)
0.3.0.post4
>>> print(tensorflow.__version__)
1.4.1
```

What am I doing wrong here? Any help is appreciated. Thank you.