mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 03:42:50 +08:00
Summary: Address black + isort fbsource linter warnings from D20558374 (previous diff) Reviewed By: nikhilaravi Differential Revision: D20558373 fbshipit-source-id: d3607de4a01fb24c0d5269634563a7914bddf1c8
28 lines
926 B
Python
28 lines
926 B
Python
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
|
|
|
|
|
|
import torch
|
|
from fvcore.common.benchmark import benchmark
|
|
from test_chamfer import TestChamfer
|
|
|
|
|
|
def bm_chamfer() -> None:
|
|
kwargs_list_naive = [
|
|
{"batch_size": 1, "P1": 32, "P2": 64, "return_normals": False},
|
|
{"batch_size": 1, "P1": 32, "P2": 64, "return_normals": True},
|
|
{"batch_size": 32, "P1": 32, "P2": 64, "return_normals": False},
|
|
]
|
|
benchmark(
|
|
TestChamfer.chamfer_naive_with_init,
|
|
"CHAMFER_NAIVE",
|
|
kwargs_list_naive,
|
|
warmup_iters=1,
|
|
)
|
|
|
|
if torch.cuda.is_available():
|
|
kwargs_list = kwargs_list_naive + [
|
|
{"batch_size": 1, "P1": 1000, "P2": 3000, "return_normals": False},
|
|
{"batch_size": 1, "P1": 1000, "P2": 30000, "return_normals": True},
|
|
]
|
|
benchmark(TestChamfer.chamfer_with_init, "CHAMFER", kwargs_list, warmup_iters=1)
|