What does this strange C++ syntax do?
From what I understand, 3 arguments are being passed to m.def(). I don't understand the syntax of the second argument passed, i.e. [] (Observable...){} What does this mean?
m.def(
  &quot;DumpHistogramFile&quot;,
  [](Observable&lt;NetBase&gt;::Observer* ob) {
    HistogramNetObserver* hist_ob =
        dynamic_cast_if_rtti&lt;HistogramNetObserver*&gt;(ob);
    hist_ob-&gt;DumpHistogramFile();
  },
  pybind11::arg(&quot;ob&quot;));

I found this syntax in the pytorch source code

The second argument is a function that takes a pointer to an Observer and doesn't return anything. When executed, it calls DumpHistogramFile. This is called a lambda expression.
