mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-01 05:11:09 +00:00
add external files
This commit is contained in:
parent
7823243dbe
commit
92aa3ea078
122 changed files with 1087 additions and 0 deletions
2
crates/erg_compiler/lib/external/torchvision.d/__init__.d.er
vendored
Normal file
2
crates/erg_compiler/lib/external/torchvision.d/__init__.d.er
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.datasets = pyimport "./datasets"
|
||||
.transforms = pyimport "./transforms"
|
7
crates/erg_compiler/lib/external/torchvision.d/datasets.d/__init__.d.er
vendored
Normal file
7
crates/erg_compiler/lib/external/torchvision.d/datasets.d/__init__.d.er
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
.cifar = pyimport "./cifar"
|
||||
.mnist = pyimport "./mnist"
|
||||
.utils = pyimport "./utils"
|
||||
.vision = pyimport "./vision"
|
||||
|
||||
{.CIFAR10; .CIFAR100;} = .cifar
|
||||
{.MNIST; .FashionMNIST;} = .mnist
|
23
crates/erg_compiler/lib/external/torchvision.d/datasets.d/cifar.d.er
vendored
Normal file
23
crates/erg_compiler/lib/external/torchvision.d/datasets.d/cifar.d.er
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
vision = pyimport "./vision"
|
||||
|
||||
.CIFAR10: ClassType
|
||||
.CIFAR10 <: vision.VisionDataset
|
||||
.CIFAR10.
|
||||
__call__: (
|
||||
root: Str,
|
||||
train := Bool,
|
||||
download := Bool,
|
||||
transform := GenericCallable,
|
||||
target_transform := GenericCallable,
|
||||
) -> .CIFAR10
|
||||
|
||||
.CIFAR100: ClassType
|
||||
.CIFAR100 <: .CIFAR10
|
||||
.CIFAR100.
|
||||
__call__: (
|
||||
root: Str,
|
||||
train := Bool,
|
||||
download := Bool,
|
||||
transform := GenericCallable,
|
||||
target_transform := GenericCallable,
|
||||
) -> .CIFAR100
|
23
crates/erg_compiler/lib/external/torchvision.d/datasets.d/mnist.d.er
vendored
Normal file
23
crates/erg_compiler/lib/external/torchvision.d/datasets.d/mnist.d.er
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
vision = pyimport "./vision"
|
||||
|
||||
.MNIST: ClassType
|
||||
.MNIST <: vision.VisionDataset
|
||||
.MNIST.
|
||||
__call__: (
|
||||
root: Str,
|
||||
train := Bool,
|
||||
download := Bool,
|
||||
transform := GenericCallable,
|
||||
target_transform := GenericCallable,
|
||||
) -> .MNIST
|
||||
|
||||
.FashionMNIST: ClassType
|
||||
.FashionMNIST <: .MNIST
|
||||
.FashionMNIST.
|
||||
__call__: (
|
||||
root: Str,
|
||||
train := Bool,
|
||||
download := Bool,
|
||||
transform := GenericCallable,
|
||||
target_transform := GenericCallable,
|
||||
) -> .FashionMNIST
|
0
crates/erg_compiler/lib/external/torchvision.d/datasets.d/utils.d.er
vendored
Normal file
0
crates/erg_compiler/lib/external/torchvision.d/datasets.d/utils.d.er
vendored
Normal file
15
crates/erg_compiler/lib/external/torchvision.d/datasets.d/vision.d.er
vendored
Normal file
15
crates/erg_compiler/lib/external/torchvision.d/datasets.d/vision.d.er
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
dataset = pyimport "torch/utils/data/dataset"
|
||||
{Tensor!;} = pyimport "torch"
|
||||
|
||||
.VisionDataset: ClassType
|
||||
.VisionDataset <: dataset.Dataset
|
||||
.VisionDataset|<: Indexable(Nat, (Tensor!(Float, _), Tensor!(Float, _)))|.
|
||||
__getitem__: (index: Nat) -> (Tensor!(Float, _), Tensor!(Float, _))
|
||||
.VisionDataset.
|
||||
__call__: (
|
||||
root: Str,
|
||||
train := Bool,
|
||||
download := Bool,
|
||||
transform := GenericCallable,
|
||||
target_transform := GenericCallable,
|
||||
) -> .VisionDataset
|
3
crates/erg_compiler/lib/external/torchvision.d/models.d/__init__.d.er
vendored
Normal file
3
crates/erg_compiler/lib/external/torchvision.d/models.d/__init__.d.er
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
.resnet = pyimport "./resnet"
|
||||
|
||||
{.ResNet; .resnet18;} = .resnet
|
6
crates/erg_compiler/lib/external/torchvision.d/models.d/resnet.d.er
vendored
Normal file
6
crates/erg_compiler/lib/external/torchvision.d/models.d/resnet.d.er
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
{.Module;} = pyimport "torch/nn"
|
||||
|
||||
.ResNet: ClassType
|
||||
.ResNet <: .Module
|
||||
|
||||
.resnet18: () -> .ResNet
|
0
crates/erg_compiler/lib/external/torchvision.d/package.er
vendored
Normal file
0
crates/erg_compiler/lib/external/torchvision.d/package.er
vendored
Normal file
11
crates/erg_compiler/lib/external/torchvision.d/transforms.d/__init__.d.er
vendored
Normal file
11
crates/erg_compiler/lib/external/torchvision.d/transforms.d/__init__.d.er
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
.Compose;
|
||||
.CenterCrop;
|
||||
.GrayScale;
|
||||
.Normalize;
|
||||
.RandomCrop;
|
||||
.RandomHorizontalFlip;
|
||||
.RandomResizedCrop;
|
||||
.Resize;
|
||||
.ToTensor;
|
||||
} = pyimport "./transforms"
|
69
crates/erg_compiler/lib/external/torchvision.d/transforms.d/transforms.d.er
vendored
Normal file
69
crates/erg_compiler/lib/external/torchvision.d/transforms.d/transforms.d.er
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
Transform: ClassType
|
||||
|
||||
.Compose: ClassType
|
||||
.Compose <: GenericCallable
|
||||
.Compose.
|
||||
__call__: (transforms: [Transform; _]) -> .Compose
|
||||
|
||||
.CenterCrop: ClassType
|
||||
.CenterCrop <: Transform
|
||||
.CenterCrop <: GenericCallable
|
||||
.CenterCrop.
|
||||
__call__: (size: Nat or (Nat, Nat) or [Nat; 2]) -> .CenterCrop
|
||||
|
||||
.GrayScale: ClassType
|
||||
.GrayScale <: Transform
|
||||
.GrayScale <: GenericCallable
|
||||
.GrayScale.
|
||||
__call__: () -> .GrayScale
|
||||
|
||||
.Normalize: ClassType
|
||||
.Normalize <: Transform
|
||||
.Normalize <: GenericCallable
|
||||
.Normalize.
|
||||
__call__: (
|
||||
mean: [Float; _],
|
||||
std: [Float; _],
|
||||
inplace := Bool,
|
||||
) -> .Normalize
|
||||
|
||||
.RandomCrop: ClassType
|
||||
.RandomCrop <: Transform
|
||||
.RandomCrop <: GenericCallable
|
||||
.RandomCrop.
|
||||
__call__: (
|
||||
size: Nat or (Nat, Nat) or [Nat; 2],
|
||||
padding := Nat or (Nat, Nat) or (Nat, Nat, Nat, Nat),
|
||||
pad_if_needed:=Bool,
|
||||
fill := Nat or (Nat, Nat, Nat),
|
||||
padding_mode := Str,
|
||||
) -> .RandomCrop
|
||||
|
||||
.RandomHorizontalFlip: ClassType
|
||||
.RandomHorizontalFlip <: Transform
|
||||
.RandomHorizontalFlip <: GenericCallable
|
||||
.RandomHorizontalFlip.
|
||||
__call__: () -> .RandomHorizontalFlip
|
||||
|
||||
.RandomResizedCrop: ClassType
|
||||
.RandomResizedCrop <: Transform
|
||||
.RandomResizedCrop <: GenericCallable
|
||||
.RandomResizedCrop.
|
||||
__call__: (size: Nat or (Nat, Nat) or [Nat; 2]) -> .RandomResizedCrop
|
||||
|
||||
.Resize: ClassType
|
||||
.Resize <: Transform
|
||||
.Resize <: GenericCallable
|
||||
.Resize.
|
||||
__call__: (
|
||||
size: Nat or (Nat, Nat) or [Nat; 2],
|
||||
interpolation := Str,
|
||||
max_size := Nat,
|
||||
antialias := Bool,
|
||||
) -> .Resize
|
||||
|
||||
.ToTensor: ClassType
|
||||
.ToTensor <: Transform
|
||||
.ToTensor <: GenericCallable
|
||||
.ToTensor.
|
||||
__call__: () -> .ToTensor
|
Loading…
Add table
Add a link
Reference in a new issue