mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[functorch] Add LICENSE headers to code files
This commit is contained in:
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from typing import Tuple, List
|
||||
import re
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from functorch import grad, vmap, pythonkey_trace, wrap_key, make_fx, nnc_jit, make_functional, grad_and_value
|
||||
import torch
|
||||
import torch.fx as fx
|
||||
@ -72,4 +78,4 @@ print("Starting NNC training")
|
||||
train(grad_nnc, weights)
|
||||
|
||||
print("Starting JIT training")
|
||||
train(jit_step, None)
|
||||
train(jit_step, None)
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from functorch import grad, nnc_jit, make_fx, make_nnc
|
||||
import torch
|
||||
import time
|
||||
@ -22,4 +28,4 @@ def bench(name, f, iters=10000, warmup=3):
|
||||
|
||||
bench("Pytorch: ", lambda: grad_pt(inp))
|
||||
bench("FX: ", lambda: grad_fx(inp))
|
||||
bench("NNC: ", lambda: grad_nnc(inp))
|
||||
bench("NNC: ", lambda: grad_nnc(inp))
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import torch
|
||||
import functools
|
||||
from . import _C
|
||||
|
@ -0,0 +1,5 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import torch
|
||||
from functools import partial, wraps
|
||||
import collections
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
from torch import Tensor
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import time
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import functools
|
||||
from typing import Any, Dict, NamedTuple, Optional, Set, Tuple, List, Callable, Union
|
||||
import torch
|
||||
@ -119,4 +125,4 @@ def make_nnc(f):
|
||||
compiled_f = nnc_compile(fx_model, args, get_loopnest=True)
|
||||
return compiled_f
|
||||
|
||||
return wrapped
|
||||
return wrapped
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import torch.utils._pytree as _pytree
|
||||
from torch.utils._pytree import tree_flatten, tree_unflatten, TreeSpec
|
||||
from typing import List, Any
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import torch
|
||||
import functools
|
||||
from torch import Tensor
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchRulesHelper.h>
|
||||
#include <functorch/csrc/PlumbingHelper.h>
|
||||
#include <functorch/csrc/InPlacePlumbing.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchRulesHelper.h>
|
||||
|
||||
namespace at { namespace functorch {
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchRulesHelper.h>
|
||||
|
||||
namespace at { namespace functorch {
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchRulesHelper.h>
|
||||
#include <ATen/WrapDimUtils.h>
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <ATen/native/ResizeCommon.h>
|
||||
#include <ATen/ATen.h>
|
||||
#include <torch/csrc/autograd/variable.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchRulesHelper.h>
|
||||
|
||||
namespace at { namespace functorch {
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchRulesHelper.h>
|
||||
#include <functorch/csrc/PlumbingHelper.h>
|
||||
#include <functorch/csrc/BatchedFallback.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchRulesHelper.h>
|
||||
|
||||
namespace at { namespace functorch {
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchRulesHelper.h>
|
||||
#include <functorch/csrc/PlumbingHelper.h>
|
||||
#include <functorch/csrc/InPlacePlumbing.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchRulesHelper.h>
|
||||
#include <iostream>
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchedFallback.h>
|
||||
#include <functorch/csrc/VmapTransforms.h>
|
||||
#include <functorch/csrc/Constants.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#pragma once
|
||||
#include <ATen/ATen.h>
|
||||
#include <ATen/core/op_registration/op_registration.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/BatchedTensorImpl.h>
|
||||
|
||||
#include <ATen/WrapDimUtils.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <bitset>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#pragma once
|
||||
#include <ATen/Tensor.h>
|
||||
#include <functorch/csrc/OutOfPlacePlumbing.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <torch/library.h>
|
||||
#include <ATen/native/ResizeCommon.h>
|
||||
#include <ATen/ATen.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#pragma once
|
||||
#include <c10/core/DispatchKey.h>
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/DynamicLayer.h>
|
||||
#include <functorch/csrc/TensorWrapper.h>
|
||||
#include <functorch/csrc/BatchedTensorImpl.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#pragma once
|
||||
#include <c10/core/DispatchKey.h>
|
||||
#include <c10/util/Optional.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functorch/csrc/PlumbingHelper.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/OutOfPlacePlumbing.h>
|
||||
|
||||
#include <functorch/csrc/PlumbingHelper.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/TensorWrapper.h>
|
||||
#include <functorch/csrc/DynamicLayer.h>
|
||||
#include <functorch/csrc/BatchedTensorImpl.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <ATen/Tensor.h>
|
||||
#include <functorch/csrc/BatchedTensorImpl.h>
|
||||
#include <functorch/csrc/Constants.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/PythonKey.h>
|
||||
#include <torch/csrc/utils/pybind.h>
|
||||
#include <torch/csrc/jit/python/pybind_utils.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <torch/csrc/utils/pybind.h>
|
||||
#include <ATen/Tensor.h>
|
||||
#include <torch/library.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/TensorWrapper.h>
|
||||
#include <functorch/csrc/DynamicLayer.h>
|
||||
#include <functorch/csrc/BatchedTensorImpl.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ATen/Tensor.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <torch/library.h>
|
||||
#include <ATen/ATen.h>
|
||||
#include <functorch/csrc/VmapTransforms.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/VmapTransforms.h>
|
||||
#include <functorch/csrc/DynamicLayer.h>
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functorch/csrc/BatchedTensorImpl.h>
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <torch/extension.h>
|
||||
#include <ATen/WrapDimUtils.h>
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
// Copyright (c) Facebook, Inc. and its affiliates.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree.
|
||||
|
||||
#include <functorch/csrc/DynamicLayer.h>
|
||||
#include <functorch/csrc/Constants.h>
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import distutils.command.clean
|
||||
import shutil
|
||||
import glob
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
import itertools
|
||||
import types
|
||||
import functools
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from torch.testing._internal.common_utils import TestCase, run_tests
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from torch.testing._internal.common_utils import TestCase, run_tests, is_iterable_of_tensors
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from torch.testing._internal.common_utils import TestCase, run_tests
|
||||
import torch
|
||||
import torch.nn as nn
|
||||
|
@ -1,3 +1,9 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the BSD-style license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
from torch.testing._internal.common_utils import TestCase, run_tests
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
Reference in New Issue
Block a user