界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

backend-and-configuration

backend-and-configuration

【效率与协作】Install and select DeepXDE tensor backends and configure dtype, autodiff, random seed, XLA, GPU, and parallel settings.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: backend-and-configuration description: "Install and select DeepXDE tensor backends and configure dtype, autodiff, random seed, XLA, GPU, and parallel settings." disable-model-invocation: true metadata: disco-role: operating license: LGPL 2.1

DeepXDE backend and configuration

Use this sub-skill when the task is about choosing or diagnosing a DeepXDE tensor backend, installing backend-specific dependencies, or configuring dde.config settings such as dtype, autodiff mode, random seed, XLA, and parallel scaling.

This construction verified DeepXDE with the PyTorch backend on CPU. TensorFlow, JAX, PaddlePaddle, GPU, Horovod, and MPI paths are supported by DeepXDE but were not runtime-verified here; treat them as optional/alternative paths until checked in the target environment.

Fast path

  1. Select the backend before importing DeepXDE:
    DDE_BACKEND=pytorch python your_script.py
    
    or, inside Python before import deepxde:
    import os
    os.environ.setdefault("DDE_BACKEND", "pytorch")
    import deepxde as dde
    
  2. Run the diagnostic helper when imports or devices are uncertain:
    python scripts/check_backend.py --backend pytorch
    python scripts/check_backend.py --backend tensorflow --json
    
  3. Apply configuration immediately after importing DeepXDE and before constructing data, networks, or models:
    dde.config.set_default_float("float32")
    dde.config.set_random_seed(1234)
    dde.config.set_default_autodiff("reverse")
    

Runtime references

Route out of this sub-skill

Operating rules

  • Do not rely on backend auto-detection in reproducible scripts. Set DDE_BACKEND explicitly or set the saved DeepXDE config.
  • Backend selection is resolved during import. Changing DDE_BACKEND after import deepxde is too late for the current process.
  • Prefer pytorch for CPU-safe examples in this generated skill unless the user explicitly requests another backend and the required package set is installed.
  • Never claim GPU, Horovod, TensorFlow, JAX, or PaddlePaddle verification from this skill alone. Use the diagnostic script and environment-specific tests first.
我的收藏