mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-05 23:38:42 +08:00
Updated formatting
This commit is contained in:
1 parent
66d23199ff
commit
27b8d94f84
1 file changed
+2
-2
+2
-2
@@ -21,9 +21,9 @@ import json
|
|||||||
from pydoc import locate
|
from pydoc import locate
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
from math import floor, log
|
||||||
import torch
|
import torch
|
||||||
from omegaconf import DictConfig
|
from omegaconf import DictConfig
|
||||||
from math import floor, log
|
|
||||||
|
|
||||||
|
|
||||||
class DotDict(dict):
|
class DotDict(dict):
|
||||||
@@ -98,4 +98,4 @@ def human_format(num):
|
|||||||
units = ["", "K", "M", "B", "T", "P"]
|
units = ["", "K", "M", "B", "T", "P"]
|
||||||
k = 1000.0
|
k = 1000.0
|
||||||
magnitude = int(floor(log(num, k)))
|
magnitude = int(floor(log(num, k)))
|
||||||
return "%.2f %s" % (num / k**magnitude, units[magnitude])
|
return f"{(num / k**magnitude):.2f} {units[magnitude]}"
|
||||||
Reference in new issue
Block a user