const CUDAExt = Base.get_extension(TensorKit, :TensorKitCUDAExt)
@assert !isnothing(CUDAExt)
const CuTensorMap = getglobal(CUDAExt, :CuTensorMap)
This is awful!!!
What if instead, we defined CuTensorMap in src/TensorKit.jl but made it MethodError unless the extension is loaded (which would then provide the actual constructors).