Returns a unique id (pointer) of the given object, which can be a Torch object, a table, a thread or a function.