sponge.function.set_global_units
====================================

.. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg
    :target: https://gitee.com/mindspore/mindscience/blob/master/MindSPONGE/docs/api/api_python/function/sponge.function.set_global_units.rst
    :alt: 查看源文件


.. py:function:: sponge.function.set_global_units(length_unit: Union[str, Units, Length, float, int] = None, energy_unit: Union[str, Units, Length, float, int] = None, units: Units = None)

    给全局单位设置单位。

    参数:
        - **length_unit** (Union[str, Units, Length, float, int]) - 长度单位。仅当 `units` 为 None 时才有效。默认值: ``None``。
        - **energy_unit** (Union[str, Units, Length, float, int]) - 能量单位。仅当 `units` 为 None 时才有效。默认值: ``None``。
        - **units** (Units) - 单位。默认值: ``None``。