Add PyMemberDef for __dict__ on eager tensors.
This fixes dir() calls on instances of eager tensors so that it correctly accesses the __dict__ of EagerTensorType. Earlier it would fail due to an infinite "loop" in subtype_dict: https://github.com/python/cpython/blob/7e610bcdf128f61b925654e4fa80fbac83537d0e/Objects/typeobject.c#L2145 get_builtin_base_with_dict will return the same type (though I'm not sure this is reasonable behavior given its name). The __dict__ getter for the type is subtype_dict creating an infinite tail recursion. PiperOrigin-RevId: 212020695
Loading
Please sign in to comment