Instructions to use jonl521/modeling_simple with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jonl521/modeling_simple with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("jonl521/modeling_simple", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download .venv/lib/python3.14/site-packages/torch/include/ATen/DeviceGuard.h from jonl521/modeling_simple: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/torch/include/ATen/DeviceGuard.h
- Command line
-
hf download hf://jonl521/modeling_simple/.venv/lib/python3.14/site-packages/torch/include/ATen/DeviceGuard.h
-
curl -L -o DeviceGuard.h https://huggingface.co/jonl521/modeling_simple/resolve/main/.venv/lib/python3.14/site-packages/torch/include/ATen/DeviceGuard.h
1.17 kB
| namespace at { | |
| // Are you here because you're wondering why DeviceGuard(tensor) no | |
| // longer works? For code organization reasons, we have temporarily(?) | |
| // removed this constructor from DeviceGuard. The new way to | |
| // spell it is: | |
| // | |
| // OptionalDeviceGuard guard(device_of(tensor)); | |
| /// Return the Device of a Tensor, if the Tensor is defined. | |
| inline std::optional<Device> device_of(const Tensor& t) { | |
| if (t.defined()) { | |
| return t.device(); | |
| } else { | |
| return std::nullopt; | |
| } | |
| } | |
| inline std::optional<Device> device_of(const std::optional<Tensor>& t) { | |
| return t.has_value() ? device_of(t.value()) : std::nullopt; | |
| } | |
| /// Return the Device of a TensorList, if the list is non-empty and | |
| /// the first Tensor is defined. (This function implicitly assumes | |
| /// that all tensors in the list have the same device.) | |
| inline std::optional<Device> device_of(ITensorListRef t) { | |
| if (!t.empty()) { | |
| return device_of(t.front()); | |
| } else { | |
| return std::nullopt; | |
| } | |
| } | |
| } // namespace at | |