Hi,
Anybody has any idea about the AttributeError: ‘TensorVariable’ object has no attribute ‘arctan2’?
I am using customized function in Pymc3. Looks like Theano recognize the numpy functions arccos, sqrt but not the arctan2 function. I tested arctan and it works. But that is not what I want. I looked into the Theano document, there seems to have a arctan2 function built in the basics.
I wonder why this happens?
Thanks!
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-114-53c8728a77ad> in <module>
20 tpw_pole_angle = None,
21 tpw_rate_scale = None,
---> 22 sample_size = 2000)
<ipython-input-113-cfc6a15ee3bc> in create_model(name, paleomagnetic_pole_list, A95_list, age_list, age_uncertainty_list, age_uncertainty_type_list, n_euler_poles, include_tpw, site_lon_lat, k, kw, euler_rate, tpw_pole_angle, tpw_rate_scale, sample_size)
81 lon_lat = pole_position(start, start_age, this_age, euler_list, rate_list, changepoint_list, tpw_pole_angle, tpw_rate)
82 else:
---> 83 lon_lat = pole_position(start, start_age, this_age, euler_list, rate_list, changepoint_list)
84
85 # print(lon_lat)
<ipython-input-112-74444e1e42c3> in pole_position(start, start_age, this_age, euler_list, rate_list, changepoint_list, tpw_pole_angle, tpw_rate)
41 break
42
---> 43 lon, lat, _ = cartesian_to_spherical(this_pole)
44 return T.stacklists([lon[0], lat[0]])
<ipython-input-111-1affa050701b> in cartesian_to_spherical(vecs)
66 norm = np.sqrt(v[0, :] * v[0, :] + v[1, :] * v[1, :] + v[2, :] * v[2, :])
67 latitude = 90. - np.arccos(v[2, :] / norm) * r2d
---> 68 longitude = np.arctan2(v[1, :],v[0, :]) * r2d
69
70 return longitude, latitude, norm
AttributeError: 'TensorVariable' object has no attribute 'arctan2'