def get_params_and_grads(graph, cost):
    grads = []
    params = []
    for k, p in graph.items():
        if k[:2] == "__":
            # skip private tags
            continue
        print("Computing grad w.r.t %s" % k)
        grad = tensor.grad(cost, p)
        params.append(p)
        grads.append(grad)
    return params, grads
dataset/ETHPy150Open kastnerkyle/SciPy2015/graphics_code/cvae/kdl_template.py/get_params_and_grads/original