Commit d644e729 authored by Akshay Modi's avatar Akshay Modi Committed by TensorFlower Gardener
Browse files

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
parent ca92311c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment