anchor.diff:      ninja
     ] ++ lib.optionals cudaSupport [ cudatoolkit_joined ];
   
  -  buildInputs = [
  -    numpy.blas
  -  ] ++ lib.optionals cudaSupport [ cudnn magma nccl ]
  +  buildInputs = [ blas ]
  +    ++ lib.optionals cudaSupport [ cudnn magma nccl ]
       ++ lib.optionals stdenv.isLinux [ numactl ];
   
     propagatedBuildInputs = [
  
positive.code: let
    hasDependency = dep: pkg: lib.lists.any (inp: inp == dep) pkg.buildInputs;
    matchesCudatoolkit = hasDependency cudatoolkit;
    matchesMkl = hasDependency mkl;
  in
  # confirm that cudatoolkits are sync'd across dependencies
  assert !(openMPISupport && cudaSupport) || matchesCudatoolkit openmpi;
  assert !cudaSupport || matchesCudatoolkit magma;
  
  # confirm that mkl is sync'd across dependencies
  assert !mklSupport || mkl != null;
  assert !(mklSupport && cudaSupport) || matchesMkl magma;
  assert !mklSupport || (numpy.blasImplementation == "mkl" && numpy.blas == mkl);
  
  let
    cudatoolkit_joined = symlinkJoin {
  
negative.code:     homepage    = "https://pytorch.org/";
      license     = lib.licenses.bsd3;
      platforms   = with lib.platforms; linux ++ lib.optionals (!cudaSupport) darwin;
      maintainers = with lib.maintainers; [ teh thoughtpolice tscholak ]; # tscholak esp. for darwin-related builds
    };
  }
  