# Path: autograd/numpy/numpy_wrapper.py
# def wrap_namespace(old, new):
#     unchanged_types = {float, int, type(None), type}
#     int_types = {_np.int8, _np.int16, _np.int32, _np.int64, _np.integer}
#     for name, obj in old.items():
#         if obj in notrace_functions:
#             new[name] = notrace_primitive(obj)
#         elif callable(obj) and type(obj) is not type:
#             new[name] = primitive(obj)
#         elif type(obj) is type and obj in int_types:
#             new[name] = wrap_intdtype(obj)
#         elif type(obj) in unchanged_types:
#             new[name] = obj
# 
# Path: autograd/extend.py



import scipy.linalg
import autograd.numpy as anp
from autograd.numpy.numpy_wrapper import wrap_namespace
from autograd.extend import defvjp, defvjp_argnums, defjvp, defjvp_argnums
from __future__ import division


wrap_namespace(scipy.linalg.__dict__, globals())  # populates module namespace

def _vjp_sqrtm(ans, A, disp=True, blocksize=64):
    assert disp, "sqrtm vjp not implemented for disp=False"
    ans_transp = anp.transpose(ans)
    def vjp(g):
        return anp.real(solve_sylvester(ans_transp, ans_transp, g))
    return vjp

# Path: autograd/numpy/numpy_wrapper.py
# def wrap_namespace(old, new):
#     unchanged_types = {float, int, type(None), type}
#     int_types = {_np.int8, _np.int16, _np.int32, _np.int64, _np.integer}
#     for name, obj in old.items():
#         if obj in notrace_functions:
#             new[name] = notrace_primitive(obj)
#         elif callable(obj) and type(obj) is not type:
#             new[name] = primitive(obj)
#         elif type(obj) is type and obj in int_types:
#             new[name] = wrap_intdtype(obj)
#         elif type(obj) in unchanged_types:
#             new[name] = obj
# 
# Path: autograd/extend.py



# Path: autograd/scipy/linalg.py
import scipy.linalg
import autograd.numpy as anp
from autograd.numpy.numpy_wrapper import wrap_namespace
from autograd.extend import defvjp, defvjp_argnums, defjvp, defjvp_argnums

from __future__ import division


wrap_namespace(scipy.linalg.__dict__, globals())  # populates module namespace

def _vjp_sqrtm(ans, A, disp=True, blocksize=64):
    assert disp, "sqrtm vjp not implemented for disp=False"
    ans_transp = anp.transpose(ans)
    def vjp(g):
        return anp.real(solve_sylvester(ans_transp, ans_transp, g))
    return vjp

defvjp(sqrtm, _vjp_sqrtm)