TypeErrors : Unsupported dtype for TensorType: object (Working with coordinate data)


I’m trying to create a normal distribution of the z component of 3D coordinates. After the sampling, I would like to attach the generated sampled z values back with the other x and y coordinate.

I would like to use the coordinates for other calculations. Any help would be highly appreciated. Thank you. Kindly find my code attached.

import pymc as pm
import numpy as np
import theano.tensor as T
full_data = np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6]])
z = np.array([1, 2, 2, 61])
shape_0 = z

def control_point_unc(prior, shape_0, uncert):
    lent = len(shape_0.eval())
    m_pr = T.zeros(lent)
    m_pr = T.set_subtensor(m_pr[:], uncert[:])
    a = []
    for i in range(lent):
        x = T.zeros((lent))
        #x = T.set_subtensor(prior[i][2], m_prt[i])
        x = T.set_subtensor(prior[i][2], uncert[i])

    zu = T.stack(a)
    #zuu = T.concatenate(a, axis=0)

    return zu

with pm.Model() as model_2:
    top_surface_uncertainty_z = pm.Normal('top_surface_uncertainties', mu=z, sigma=1, shape= 4)
    full_data_ = T.as_tensor_variable(full_data) 
    shape_0_ = T.as_tensor_variable(shape_0) 
    coords = pm.Deterministic("one", control_point_unc(prior= full_data_ , shape_0 = shape_0_, uncert = top_surface_uncertainty_z))
    trace = pm.sample(10, tune=50, return_inferencedata=False)

I would also like to know if the .eval() can be used to extract the coordinates so that I can use them for calculations. Please, ignore my ignorance. Thank you.