python_code stringlengths 0 679k | repo_name stringlengths 9 41 | file_path stringlengths 6 149 |
|---|---|---|
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/imageContainers/rgba8888Image.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/imageContainers/rgb888Image.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/config/__init__.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/config/configManager.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/utils/__init__.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/utils/other.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/utils/threading.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/utils/cli.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/utils/image.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/__init__.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/mainWindow.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/centralWidgets/__init__.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/centralWidgets/view.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/centralWidgets/compare.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/loadingIndicators/fourCorners.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/loadingIndicators/line.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/loadingIndicators/blink.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/loadingIndicators/__init__.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/loadingIndicators/common.py |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | PixelView-master | PixelView/gui/loadingIndicators/abstractLoadingIndicator.py |
#!/usr/bin/env python2.7
#
# Copyright (c) 2015-2021, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
#
# Collect periodic heap profiles from proxyfsd using the
# HTTP interface. This requies that proxyfsd be compiled with the
# patch included below.
#
import os
import sys
import datetime
import argparse
cm... | proxyfs-development | bin/profile-proxyfsd.py |
#!/usr/bin/env python
#
# Copyright (c) 2015-2021, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
#
#
# Exercise the multipart-upload functionality of S3API using the aws
# command from the awscli package and perform some validation of the
# results.
#
# The aws command needs a file ~/.aws/config that conta... | proxyfs-development | bin/aws-multipart-test.py |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015-2021, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
#
# ProxyFS documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 20 11:16:31 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note tha... | proxyfs-development | docs/source/conf.py |
# Copyright 2010 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""GDB Pretty printers and convenience functions for Go's runtime structures.
This script is loaded by GDB when it finds a .debug_gdb_scripts
section in the compi... | proxyfs-development | cookbooks/proxyfs/files/default/usr/local/go/src/runtime/runtime-gdb.py |
"""
The MIT License (MIT)
Copyright (c) 2020 NVIDIA
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publi... | healthcare-on-tap-TRT-TRITON-demo-master | sim_inference_req_triton.py |
"""
The MIT License (MIT)
Copyright (c) 2020 NVIDIA
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publi... | healthcare-on-tap-TRT-TRITON-demo-master | lib/triton_utils.py |
healthcare-on-tap-TRT-TRITON-demo-master | lib/__init__.py | |
"""
The MIT License (MIT)
Copyright (c) 2020 NVIDIA
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publi... | healthcare-on-tap-TRT-TRITON-demo-master | lib/dataset_utils.py |
"""
The MIT License (MIT)
Copyright (c) 2020 NVIDIA
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publi... | healthcare-on-tap-TRT-TRITON-demo-master | lib/onnx_to_tensorrt7.py |
# Environment variables used during build:
#
# MAX_JOBS
# maximum number of compile jobs we should use to compile your code
#
# build argument:
#
# --cmake-only
# Only generate ./build directory with cmake setup
#
# --no-python
# Skips python API target `libnvfuser.so`, i.e. `_C.cpython-xxx.so`
#
# ... | Fuser-main | setup.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
import ast
import typing
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--symbolic_sizes", nargs="+", type=int)
cmd_args = parser.pars... | Fuser-main | tools/cpp-repro-gen.py |
import os
ext_map = {
"cpp": ("c", "cpp", "cu", "cc", "cuh", "h"),
"py": ("py",),
"txt": ("txt",),
}
licence_style_0 = """\
// clang-format off
/*
* SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*/
// ... | Fuser-main | tools/update_copyright.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
import subprocess
import sys
from pathlib import Path
UNKNOWN = "Unknown"
nvfuser_root = Path(__file__).parent.parent
# note that this root currently is still part of p... | Fuser-main | tools/gen_nvfuser_version.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
def get_available_memory_gb():
"""Returns the available memory in GB."""
try:
import psutil
return psutil.virtual_memory().available / 1024 / 10... | Fuser-main | tools/memory.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Generates a C++ header files embedding the original input as a string literal
import argparse
import pathlib
from datetime import datetime
arg_parser = argparse.Argum... | Fuser-main | tools/stringify_file.py |
Fuser-main | tools/__init__.py | |
"""
Generic linter that greps for a pattern and optionally suggests replacements.
"""
import argparse
import json
import logging
import os
import subprocess
import sys
import time
from enum import Enum
from typing import Any, List, NamedTuple, Optional
IS_WINDOWS: bool = os.name == "nt"
def eprint(*args: Any, **kw... | Fuser-main | tools/linter/adapters/grep_linter.py |
import argparse
import concurrent.futures
import json
import logging
import os
import subprocess
import sys
import time
from enum import Enum
from typing import Any, List, NamedTuple, Optional, BinaryIO
IS_WINDOWS: bool = os.name == "nt"
def eprint(*args: Any, **kwargs: Any) -> None:
print(*args, file=sys.stder... | Fuser-main | tools/linter/adapters/black_linter.py |
"""
Initializer script that installs stuff to pip.
"""
import os
import argparse
import logging
import subprocess
import sys
import time
from typing import List
def run_command(args: List[str]) -> "subprocess.CompletedProcess[bytes]":
logging.debug("$ %s", " ".join(args))
start_time = time.monotonic()
tr... | Fuser-main | tools/linter/adapters/pip_init.py |
import argparse
import json
import logging
import os
import re
import subprocess
import sys
import time
from enum import Enum
from typing import Any, Dict, List, NamedTuple, Optional, Set, Pattern
IS_WINDOWS: bool = os.name == "nt"
def eprint(*args: Any, **kwargs: Any) -> None:
print(*args, file=sys.stderr, flu... | Fuser-main | tools/linter/adapters/flake8_linter.py |
import argparse
import concurrent.futures
import json
import logging
import os
import subprocess
import sys
import time
from enum import Enum
from pathlib import Path
from typing import Any, List, NamedTuple, Optional
IS_WINDOWS: bool = os.name == "nt"
def eprint(*args: Any, **kwargs: Any) -> None:
print(*args,... | Fuser-main | tools/linter/adapters/clangformat_linter.py |
"""
EXEC: Ensure that source files are not executable.
"""
import argparse
import json
import logging
import os
import sys
from enum import Enum
from typing import NamedTuple, Optional
LINTER_CODE = "EXEC"
class LintSeverity(str, Enum):
ERROR = "error"
WARNING = "warning"
ADVICE = "advice"
DISABLED ... | Fuser-main | tools/linter/adapters/exec_linter.py |
import argparse
import concurrent.futures
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import time
from enum import Enum
from pathlib import Path
from sysconfig import get_paths as gp
from typing import Any, List, NamedTuple, Optional, Pattern
# Nvfuser directory root
resul... | Fuser-main | tools/linter/adapters/clangtidy_linter.py |
import argparse
import json
import logging
import os
import re
import subprocess
import sys
import time
from enum import Enum
from pathlib import Path
from typing import Any, Dict, List, NamedTuple, Optional, Pattern
IS_WINDOWS: bool = os.name == "nt"
def eprint(*args: Any, **kwargs: Any) -> None:
print(*args, ... | Fuser-main | tools/linter/adapters/mypy_linter.py |
"""
NEWLINE: Checks files to make sure there are no trailing newlines.
"""
import argparse
import json
import logging
import os
import sys
from enum import Enum
from typing import NamedTuple, Optional
NEWLINE = 10 # ASCII "\n"
LINTER_CODE = "NEWLINE"
class LintSeverity(str, Enum):
ERROR = "error"
WARNING =... | Fuser-main | tools/linter/adapters/newlines_linter.py |
T0 = fd.define_tensor(symbolic_sizes=[-1], contiguous=[True], dtype=DataType.Float)
T1 = fd.define_tensor(symbolic_sizes=[-1], contiguous=[True], dtype=DataType.Float)
T2 = fd.define_tensor(symbolic_sizes=[-1, -1], contiguous=[True, True], dtype=DataType.Half)
T3 = fd.ops.broadcast_in_dim(T0, output_shape=[1, 1024, 768... | Fuser-main | tools/examples/repro.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
from copy import deepcopy
from functools import partial
import itertools
import math
import random
import re
from typing import List, Call... | Fuser-main | python_tests/test_python_frontend.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
import math
import torch
import jax
from pytest_core import OpInfo, ReferenceType, Domain
from pytest_fusion_definitions import (
api_... | Fuser-main | python_tests/pytest_opinfos.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
from typing import Callable
import unittest
import torch
from torch.testing._internal.common_utils import run_tests, TEST_WITH_ROCM, Test... | Fuser-main | python_tests/test_schedule_ops.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
import torch
from pytest_core import OpInfo
from pytest_utils import ArgumentType, is_tensor
from nvfuser import FusionDefinition
from n... | Fuser-main | python_tests/pytest_fusion_definitions.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["oncall: jit"]
import contextlib
import unittest
import os
import random
import enum
import copy
from functools import reduce
import operator
import warnings... | Fuser-main | python_tests/test_torchscript.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
import torch
import jax.numpy as jnp
from torch.testing import make_tensor
from typing import Optional
from enum import Enum, auto
clas... | Fuser-main | python_tests/pytest_utils.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
import itertools
from functools import partial, wraps
import math
import torch
from torch.testing import make_tensor
import random
from n... | Fuser-main | python_tests/pytest_input_generators.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
from pytest_utils import (
all_dtypes_except_reduced,
ArgumentType,
torch_to_jax_dtype_map,
torch_to_python_dtype_map,
)
f... | Fuser-main | python_tests/pytest_core.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
import torch
import pytest
import numpy as np
from pytest_fusion_definitions import default_fd_fn, parse_inputs_fusion_definition
from py... | Fuser-main | python_tests/pytest_ops.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# Owner(s): ["module: nvfuser"]
import inspect
import torch
from typing import Callable
from pytest_utils import map_dtype_to_str
import pytest
def _instantiate_opinfo_... | Fuser-main | python_tests/pytest_framework.py |
import unittest
import pytest
import torch
import torch.nn as nn
from nvfuser.contrib.nn.normalization import InstanceNorm3dNVFuser
def assert_close(a: torch.Tensor, b: torch.Tensor):
"""Given two Tensors, compare with a reasonable precision.
If the dtypes mismatch, use a custom rule to cast one or the ot... | Fuser-main | python_tests/test_normalization.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
import torch
import nvfuser_extension # noqa: F401
t = torch.randn((5, 5), device="cuda")
expected = torch.sinh(t)
output = torch.ops.myop.sinh_nvfuser(t)
print("Expect... | Fuser-main | examples/sinh_extension/test.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
import os
nvfuser_csrc_dir = os.path.join(
os.path.dirname(os.path.a... | Fuser-main | examples/sinh_extension/setup.py |
from .patch_nvfuser import patch_installation
__all__ = ["patch_installation"]
| Fuser-main | nvfuser_python_utils/__init__.py |
import os
def patch_pytorch_nvfuser_binaries(torch_lib):
nvfuser_lib = os.path.join(
os.path.dirname(os.path.dirname(__file__)), "nvfuser", "lib"
)
import shutil
for f_name in ["libnvfuser_codegen.so"]:
shutil.copyfile(
os.path.join(nvfuser_lib, f_name),
os.pat... | Fuser-main | nvfuser_python_utils/patch_nvfuser.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
import torch
from typing import Type, Union
from ._C import DataType
NumberTypeType = Union[Type[bool], Type[int], Type[float], Type[complex]]
_torch_dtype_to_nvfuser_d... | Fuser-main | nvfuser/pytorch_utils.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
import logging
import os
import sys
from typing import Optional, Union # noqa: F401
import torch
# This is needed when libnvfuser.so is patched and doesn't have the py... | Fuser-main | nvfuser/__init__.py |
import os
__all__ = [
"cmake_prefix_path",
]
cmake_prefix_path = os.path.join(
os.path.dirname(os.path.dirname(__file__)),
"nvfuser",
"share",
"cmake",
"nvfuser",
)
| Fuser-main | nvfuser/utils.py |
# SPDX-FileCopyrightText: Copyright (c) 2023-present NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
from typing import Any
from .version import _version_str
__all__ = ["NvfuserVersion", "Version"]
class _LazyImport:
"""Wraps around classes lazy imported from packa... | Fuser-main | nvfuser/nvfuser_version.py |
from . import nn
__all__ = [
"nn",
]
| Fuser-main | nvfuser/contrib/__init__.py |
from .normalization import InstanceNorm1dNVFuser
from .normalization import InstanceNorm2dNVFuser
from .normalization import InstanceNorm3dNVFuser
__all__ = [
"InstanceNorm1dNVFuser",
"InstanceNorm2dNVFuser",
"InstanceNorm3dNVFuser",
]
| Fuser-main | nvfuser/contrib/nn/__init__.py |
import enum
from typing import Any, Dict, List, Optional, Tuple
import torch
import nvfuser
from nvfuser.pytorch_utils import torch_dtype_to_nvfuser_dtype
__all__ = [
"InstanceNorm1dNVFuser",
"InstanceNorm2dNVFuser",
"InstanceNorm3dNVFuser",
]
NamedAxis = enum.Enum("NamedAxis", ["BATCH", "CHANNEL"])
... | Fuser-main | nvfuser/contrib/nn/normalization.py |
#!/usr/bin/python3
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | DL4AGX-master | tools/packaging/package.py |
#!/usr/bin/python3
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | DL4AGX-master | tools/linter/pylint.py |
#!/usr/bin/python3
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | DL4AGX-master | tools/linter/pylint_diff.py |
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | DL4AGX-master | tools/linter/utils.py |
#!/usr/bin/python3
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | DL4AGX-master | tools/linter/cpplint_diff.py |
#!/usr/bin/python3
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | DL4AGX-master | tools/linter/cpplint.py |
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | DL4AGX-master | LeNetWithS3Pooling/training/pooling.py |
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | DL4AGX-master | LeNetWithS3Pooling/training/main.py |
##########################################################################
# Copyright (c) 2018-2019 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | DL4AGX-master | LeNetWithS3Pooling/utils/modify_onnx.py |
#
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | DL4AGX-master | SparsityINT8/step1_sparse_training.py |
#
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | DL4AGX-master | SparsityINT8/train_utils.py |
#
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | DL4AGX-master | SparsityINT8/infer_engine.py |
#
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | DL4AGX-master | SparsityINT8/step2_1_ptq_calibration.py |
#
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | DL4AGX-master | SparsityINT8/step2_2_qat_training.py |
# _base_ = [
# '../_base_/models/dest_simplemit-b0.py',
# '../_base_/datasets/cityscapes_1024x1024.py',
# '../_base_/default_runtime.py',
# '../_base_/schedules/schedule_160k.py'
# ]
_base_ = [
'../_base_/models/dest_simpatt-b0.py',
'../_base_/datasets/cityscapes_1024x1024_repeat.py',
'../... | DL4AGX-master | DEST/semseg/dest_simpatt-b0_1024x1024_160k_cityscapes.py |
# optimizer
optimizer = dict(type='AdamW', lr=0.0002, weight_decay=0.0001)
optimizer_config = dict()
# learning policy
lr_config = dict(policy='poly', power=0.9, min_lr=0.0, by_epoch=False)
# runtime settings
runner = dict(type='IterBasedRunner', max_iters=160000)
checkpoint_config = dict(by_epoch=False, interval=4000)... | DL4AGX-master | DEST/semseg/schedule_160k_adamw.py |
# _base_ = [
# '../_base_/models/dest_simplemit-b0.py',
# '../_base_/datasets/cityscapes_1024x1024.py',
# '../_base_/default_runtime.py',
# '../_base_/schedules/schedule_160k.py'
# ]
_base_ = [
'../_base_/models/dest_simpatt-b0.py',
'../_base_/datasets/cityscapes_1024x1024_repeat.py',
'../... | DL4AGX-master | DEST/semseg/dest_simpatt-b3_1024x1024_160k_cityscapes.py |
# _base_ = [
# '../_base_/models/dest_simplemit-b0.py',
# '../_base_/datasets/cityscapes_1024x1024.py',
# '../_base_/default_runtime.py',
# '../_base_/schedules/schedule_160k.py'
# ]
_base_ = [
'../_base_/models/dest_simpatt-b0.py',
'../_base_/datasets/cityscapes_1024x1024_repeat.py',
'../... | DL4AGX-master | DEST/semseg/dest_simpatt-b5_1024x1024_160k_cityscapes.py |
# model settings
embed_dims = [32, 64, 160, 256]
norm_cfg = dict(type='SyncBN', requires_grad=True)
model = dict(
type='EncoderDecoder',
pretrained=None,
backbone=dict(
type='SimplifiedTransformer',
img_size=(1024, 1024),
in_chans=3,
num_classes=19,
embed_dims=embed_d... | DL4AGX-master | DEST/semseg/dest_simpatt-b0.py |
import torch
import torch.nn as nn
from mmseg.models.builder import HEADS
from mmseg.models.decode_heads.decode_head import BaseDecodeHead
@HEADS.register_module()
class DestHead(BaseDecodeHead):
def __init__(self, segm=True, **kwargs):
super().__init__(input_transform='multiple_select', **kwargs)
... | DL4AGX-master | DEST/semseg/dest_head.py |
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
import math
import torch
import torch.nn as nn
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
from mmcv.cnn import build_norm_layer
from mmcv.runner import BaseModule
from ..builder import BACKBONES
class Mlp(nn.Module):
... | DL4AGX-master | DEST/semseg/simplified_attention_mmseg.py |
# dataset settings
dataset_type = 'CityscapesDataset'
data_root = 'data/cityscapes/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (1024, 1024)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='Resize'... | DL4AGX-master | DEST/semseg/cityscapes_1024x1024_repeat.py |
# _base_ = [
# '../_base_/models/dest_simplemit-b0.py',
# '../_base_/datasets/cityscapes_1024x1024.py',
# '../_base_/default_runtime.py',
# '../_base_/schedules/schedule_160k.py'
# ]
_base_ = [
'../_base_/models/dest_simpatt-b0.py',
'../_base_/datasets/cityscapes_1024x1024_repeat.py',
'../... | DL4AGX-master | DEST/semseg/dest_simpatt-b4_1024x1024_160k_cityscapes.py |
# _base_ = [
# '../_base_/models/dest_simplemit-b0.py',
# '../_base_/datasets/cityscapes_1024x1024.py',
# '../_base_/default_runtime.py',
# '../_base_/schedules/schedule_160k.py'
# ]
_base_ = [
'../_base_/models/dest_simpatt-b0.py',
'../_base_/datasets/cityscapes_1024x1024_repeat.py',
'../... | DL4AGX-master | DEST/semseg/dest_simpatt-b2_1024x1024_160k_cityscapes.py |
# _base_ = [
# '../_base_/models/dest_simplemit-b0.py',
# '../_base_/datasets/cityscapes_1024x1024.py',
# '../_base_/default_runtime.py',
# '../_base_/schedules/schedule_160k.py'
# ]
_base_ = [
'../_base_/models/dest_simpatt-b0.py',
'../_base_/datasets/cityscapes_1024x1024_repeat.py',
'../... | DL4AGX-master | DEST/semseg/dest_simpatt-b1_1024x1024_160k_cityscapes.py |
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
import torch
from packnet_sfm.models.SfmModel_dest import SfmModel_dest
from packnet_sfm.losses.multiview_photometric_loss import MultiViewPhotometricLoss
from packnet_sfm.models.model_utils import merge_outputs
class SelfSupModel_dest(SfmMod... | DL4AGX-master | DEST/models/SelfSupModel_dest.py |
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
import torch
from packnet_sfm.models.SelfSupModel_dest import SfmModel_dest, SelfSupModel_dest
from packnet_sfm.losses.supervised_loss import SupervisedLoss
from packnet_sfm.models.model_utils import merge_outputs
from packnet_sfm.utils.depth ... | DL4AGX-master | DEST/models/SemiSupModel_dest.py |
DL4AGX-master | DEST/models/__init__.py | |
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
import random
import torch.nn as nn
from packnet_sfm.geometry.pose import Pose
from packnet_sfm.models.base_model import BaseModel
from packnet_sfm.models.model_utils import flip_batch_input, flip_output, upsample_output
from packnet_sfm.utils.... | DL4AGX-master | DEST/models/SfmModel_dest.py |
DL4AGX-master | DEST/networks/__init__.py | |
import math
import torch
import torch.nn as nn
from packnet_sfm.networks.DEST.DEST_EncDec import DEST_Pose, SimpleTR_B0, SimpleTR_B1, SimpleTR_B2, SimpleTR_B3, SimpleTR_B4, SimpleTR_B5
class InvDepth(nn.Module):
"""Inverse depth layer"""
def __init__(self, in_channels, out_channels=1, min_depth=0.5):
... | DL4AGX-master | DEST/networks/DESTNet.py |
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
import math
import torch
import torch.nn as nn
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
class Mlp(nn.Module):
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.ReLU, drop=0.):
... | DL4AGX-master | DEST/networks/DEST/simplified_attention.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.