Вторая по частоте future-функция, которую я использовал, это абсолютный импорт
from __future__ import absolute_import
Что она делает?
Изменения, которые вносит эта инъекция описаны в PEP328
Покажу простой пример.
Допустим, есть такой пакет:
/my_package
/__init__.py
/main.py
/string.py
Смотрим код в my_package/main.py
# main.py
import string
Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта:
1. модуль в моём пакете my_package.string
2. стандартный модуль string
И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string.
Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать.
from my_package import string
или относительный импорт, но с указанием пути относительно текущего модуля main
from . import string
Еще одной неоднозначностью меньше 😎
Подробней про импорты здесь:
https://docs.python.org/3/tutorial/modules.html
#2to3#pep#basic
Какие преимущества даст переход на Vulkan для отрисовки UI в Android?
🚀Производительность: Vulkan обеспечивает более эффективную работу с GPU и CPU, сокращая оверхед и повышая FPS. Лучше работает во множество поток
🔋Энергоэффективность: Снижение нагрузки на процессор ведёт к заметной экономии заряда аккумулятора.
⛏️Контроль и гибкость: Разработчики получают больше возможностей для тонкой настройки графического рендеринга и оптимизации приложений.
✅Кроссплатформенность: Vulkan поддерживается на многих платформах, что облегчает переносимость кода и улучшает совместимость приложений.
Аналогичный переход сделала Apple, когда отказалась от OpenGL ES в iOS, заменив его на API Metal, которое призвано выполнять аналогичные функции, что и Vulkan.
#android#vulkan
‼️Vulkan станет основной технологий для рендеринга UI в Android
Начиная, с Android 17 большая часть устройств перейдет на рендеринг UI с OpenGL ES на Vulkan, а поддержку OpenGL будет убрана и станет доступна через ANGLE для трансляции команд в Vulkan.
#android#android17#vulkan#opengl
#java#minecraft#minecraft_mod#vulkan#vulkan_renderer
VulkanMod is a Fabric mod that replaces Minecraft Java's old OpenGL renderer with a modern Vulkan 1.2 engine, cutting CPU overhead, boosting GPU performance, and adding features like Wayland support and chunk optimizations for much higher FPS and smoother gameplay. Install Fabric loader, download the .jar from Modrinth or CurseForge, and drop it in your .minecraft/mods folder to enjoy lag-free worlds and better hardware use right away—perfect for high-res packs or busy servers.
https://github.com/xCollateral/VulkanMod
#rust#d3d12#gpu#hacktoberfest#metal#opengl#rust#vulkan#webgpu
**wgpu** is a powerful graphics library for Rust that works on many platforms, including Windows, macOS, Linux, and the web. It supports various graphics APIs like Vulkan, Metal, and DirectX. This library is safe and portable, making it easy to create graphics and compute applications. Using **wgpu**, you can build fast and efficient graphics programs that run on different devices and browsers, which is beneficial for developers who want to create cross-platform applications.
https://github.com/gfx-rs/wgpu
#cplusplus#best_practices#cpp#graphics#graphics_programming#khronos#tutorials#vulkan#vulkan_api#vulkan_samples
Vulkan is a powerful tool for creating high-performance graphics and computing applications. It helps developers control the GPU better, which can lead to faster and more efficient performance compared to older systems like OpenGL. Vulkan is special because it works on many different platforms, such as Windows, Linux, and Android. This means developers can create applications that run smoothly across various devices. The Vulkan Samples provide resources and tutorials to help developers learn and optimize their applications, making it easier to create high-quality graphics and computing experiences.
https://github.com/KhronosGroup/Vulkan-Samples
#cplusplus#arm#convolution#deep_learning#embedded_devices#llm#machine_learning#ml#mnn#transformer#vulkan#winograd_algorithm
MNN is a lightweight and efficient deep learning framework that helps run AI models on mobile devices and other small devices. It supports many types of AI models and can handle tasks like image recognition and language processing quickly and locally on your device. This means you can use AI features without needing to send data to the cloud, which improves privacy and speed. MNN is used in many apps, including those from Alibaba, and supports various platforms like Android and iOS. It also helps reduce the size of AI models, making them faster and more efficient.
https://github.com/alibaba/MNN