mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 20:02:49 +08:00
Summary: The shebang line `#!<path to interpreter>` is only required for Python scripts, so remove it on source files for class or function definitions. Additionally explicitly mark as executable the actual Python scripts in the codebase. Reviewed By: nikhilaravi Differential Revision: D20095778 fbshipit-source-id: d312599fba485e978a243292f88a180d71e1b55a
34 lines
986 B
Python
34 lines
986 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,
|
|
)
|