# AOT ID: ['0_forward']
from ctypes import c_void_p, c_long, c_int
import torch
import math
import random
import os
import tempfile
from math import inf, nan
from torch._inductor.hooks import run_intermediate_hooks
from torch._inductor.utils import maybe_profile
from torch._inductor.codegen.memory_planning import _align as align
from torch import device, empty_strided
from torch._inductor.async_compile import AsyncCompile
from torch._inductor.select_algorithm import extern_kernels
from torch._inductor.codegen.multi_kernel import MultiKernelCall
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid, split_scan_grid, grid_combo_kernels, start_graph, end_graph
from torch._C import _cuda_getCurrentRawStream as get_raw_stream

aten = torch.ops.aten
inductor_ops = torch.ops.inductor
_quantized = torch.ops._quantized
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cpu = torch._C._dynamo.guards._empty_strided_cpu
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
empty_strided_xpu = torch._C._dynamo.guards._empty_strided_xpu
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor
alloc_from_pool = torch.ops.inductor._alloc_from_pool
async_compile = AsyncCompile()


# kernel path: runs/run_shard_7/inductor_cache/n2/cn2nv44v22b5rijinsmwpconjpikjgpfahzjcn4fpd4fjk3kdnhg.py
# Topologically Sorted Source Nodes: [x], Original ATen: [aten.constant_pad_nd]
# Source node to ATen node mapping:
#   x => constant_pad_nd
# Graph fragment:
#   %constant_pad_nd : [num_users=1] = call_function[target=torch.ops.aten.constant_pad_nd.default](args = (%primals_1, [0, 4], 0.0), kwargs = {})
triton_poi_fused_constant_pad_nd_0 = async_compile.triton('triton_poi_fused_constant_pad_nd_0', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[128], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_constant_pad_nd_0', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 1, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_constant_pad_nd_0(in_ptr0, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 8
    x1 = (xindex // 8)
    x2 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 4, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.load(in_ptr0 + (x0 + (4*x1)), tmp2 & xmask, other=0.0)
    tl.store(out_ptr0 + (x2), tmp3, xmask)
''', device_str='cuda')


# kernel path: runs/run_shard_7/inductor_cache/dy/cdy6jvxyavfc5kodqzvnt7mpmnd4ui3yherhbzeur6mswedzijjn.py
# Topologically Sorted Source Nodes: [iadd], Original ATen: [aten.add]
# Source node to ATen node mapping:
#   iadd => add
# Graph fragment:
#   %add : [num_users=1] = call_function[target=torch.ops.aten.add.Tensor](args = (%view_5, %view_7), kwargs = {})
triton_poi_fused_add_1 = async_compile.triton('triton_poi_fused_add_1', '''
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor

from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, instance_descriptor, DeviceProperties

@triton_heuristics.pointwise(
    size_hints=[128], 
    filename=__file__,
    triton_meta={'signature': {0: '*fp32', 1: '*fp32', 2: '*fp32', 3: 'i32'}, 'device': DeviceProperties(type='cuda', index=0, cc=80, major=8, regs_per_multiprocessor=65536, max_threads_per_multi_processor=2048, multi_processor_count=108), 'constants': {}, 'configs': [AttrsDescriptor(divisible_by_16=(0, 1, 2, 3), equal_to_1=())]},
    inductor_meta={'autotune_hints': set(), 'kernel_name': 'triton_poi_fused_add_1', 'mutated_arg_names': [], 'no_x_dim': False, 'num_load': 2, 'num_reduction': 0, 'backend_hash': 'A9C866B4A14FD3277824029365D703C2427B2E685E54EC9B3EF4ADC8D1EEAC1D', 'are_deterministic_algorithms_enabled': False, 'assert_indirect_indexing': True, 'autotune_local_cache': True, 'autotune_pointwise': True, 'autotune_remote_cache': None, 'force_disable_caches': False, 'dynamic_scale_rblock': True, 'max_autotune': False, 'max_autotune_pointwise': False, 'min_split_scan_rblock': 256, 'spill_threshold': 16, 'store_cubin': False},
    min_elem_per_thread=0
)
@triton.jit
def triton_poi_fused_add_1(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK : tl.constexpr):
    xnumel = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 8
    x3 = (xindex // 8)
    x4 = xindex % 32
    x5 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + (10*x3)), xmask)
    tmp1 = tl.load(in_ptr1 + (x4), xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(out_ptr0 + (x5), tmp2, xmask)
''', device_str='cuda')


async_compile.wait(globals())
del async_compile

def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_2, (4, 4, 4, 2), (32, 8, 2, 1))
    assert_size_stride(primals_3, (4, 4, 2), (8, 2, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 4, 8), (32, 8, 1), torch.float32)
        # Topologically Sorted Source Nodes: [x], Original ATen: [aten.constant_pad_nd]
        stream0 = get_raw_stream(0)
        triton_poi_fused_constant_pad_nd_0.run(primals_1, buf0, 128, grid=grid(128), stream=stream0)
        del primals_1
        # Topologically Sorted Source Nodes: [x, x_ft], Original ATen: [aten.constant_pad_nd, aten._fft_r2c]
        buf1 = torch.ops.aten._fft_r2c.default(buf0, [2], 0, True)
        buf2 = buf1
        del buf1
        # Topologically Sorted Source Nodes: [out_ft], Original ATen: [aten.zeros_like]
        buf3 = torch.ops.aten.full.default([4, 4, 5], 0, dtype=torch.complex64, layout=torch.strided, device=device(type='cuda', index=0), pin_memory=False)
        buf4 = buf3
        del buf3
        # Topologically Sorted Source Nodes: [getitem], Original ATen: [aten.slice]
        buf5 = torch.ops.aten.slice.Tensor(buf2, 2, 0, 4)
        buf6 = buf5
        # Topologically Sorted Source Nodes: [view_as_complex], Original ATen: [aten.view_as_complex]
        buf7 = torch.ops.aten.view_as_complex.default(primals_2)
        buf8 = buf7
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.unsqueeze]
        buf9 = torch.ops.aten.unsqueeze.default(buf6, 3)
        buf10 = buf9
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.permute]
        buf11 = torch.ops.aten.permute.default(buf10, [0, 3, 2, 1])
        buf12 = buf11
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.unsqueeze]
        buf13 = torch.ops.aten.unsqueeze.default(buf8, 3)
        buf14 = buf13
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.permute]
        buf15 = torch.ops.aten.permute.default(buf14, [3, 1, 2, 0])
        buf16 = buf15
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.permute]
        buf17 = torch.ops.aten.permute.default(buf12, [2, 0, 3, 1])
        buf18 = buf17
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.view]
        buf19 = torch.ops.aten.reshape.default(buf18, [4, 4, 4])
        buf20 = buf19
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.permute]
        buf21 = torch.ops.aten.permute.default(buf16, [2, 3, 1, 0])
        buf22 = buf21
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.view]
        buf23 = torch.ops.aten.reshape.default(buf22, [4, 4, 4])
        buf24 = buf23
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.bmm]
        buf25 = torch.ops.aten.bmm.default(buf20, buf24)
        del buf13
        del buf14
        del buf15
        del buf16
        del buf21
        del buf22
        del buf23
        del buf24
        del buf7
        del buf8
        del primals_2
        buf26 = buf25
        del buf25
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.view]
        buf27 = torch.ops.aten.reshape.default(buf26, [4, 4, 1, 4])
        buf28 = buf27
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.permute]
        buf29 = torch.ops.aten.permute.default(buf28, [1, 3, 0, 2])
        buf30 = buf29
        # Topologically Sorted Source Nodes: [einsum], Original ATen: [aten.view]
        buf31 = torch.ops.aten.reshape.default(buf30, [4, 4, 4])
        buf32 = buf31
        # Topologically Sorted Source Nodes: [setitem], Original ATen: [aten.slice]
        buf33 = torch.ops.aten.slice.Tensor(buf4, 2, 0, 4)
        buf34 = buf33
        # Topologically Sorted Source Nodes: [setitem], Original ATen: [aten.copy]
        buf35 = torch.ops.aten.copy.default(buf34, buf32)
        del buf26
        del buf27
        del buf28
        del buf29
        del buf30
        del buf31
        del buf32
        buf36 = buf35
        del buf35
        # Topologically Sorted Source Nodes: [], Original ATen: []
        buf37 = torch.ops.aten.slice_scatter.default(buf4, buf36, 2, 0, 4)
        del buf36
        buf38 = buf37
        del buf37
        # Topologically Sorted Source Nodes: [view_as_complex_1], Original ATen: [aten.view_as_complex]
        buf39 = torch.ops.aten.view_as_complex.default(primals_3)
        buf40 = buf39
        # Topologically Sorted Source Nodes: [iadd], Original ATen: [aten.slice]
        buf41 = torch.ops.aten.slice.Tensor(buf38, 2, 0, 4)
        buf42 = buf41
        # Topologically Sorted Source Nodes: [iadd], Original ATen: [aten.add]
        buf43 = torch.ops.aten.view.dtype(buf42, torch.float32)
        buf44 = buf43
        # Topologically Sorted Source Nodes: [iadd], Original ATen: [aten.add]
        buf45 = torch.ops.aten.view.dtype(buf40, torch.float32)
        buf46 = buf45
        buf47 = reinterpret_tensor(buf0, (4, 4, 4, 2), (32, 8, 2, 1), 0); del buf0  # reuse
        # Topologically Sorted Source Nodes: [iadd], Original ATen: [aten.add]
        triton_poi_fused_add_1.run(buf44, buf46, buf47, 128, grid=grid(128), stream=stream0)
        del buf39
        del buf40
        del buf41
        del buf42
        del buf43
        del buf44
        del buf45
        del buf46
        del primals_3
        # Topologically Sorted Source Nodes: [iadd], Original ATen: [aten.add]
        buf48 = torch.ops.aten.view.dtype(reinterpret_tensor(buf47, (4, 4, 8), (32, 8, 1), 0), torch.complex64)
        buf49 = buf48
        # Topologically Sorted Source Nodes: [], Original ATen: []
        buf50 = torch.ops.aten.slice_scatter.default(buf38, buf49, 2, 0, 4)
        del buf38
        del buf47
        del buf48
        del buf49
        buf51 = buf50
        del buf50
        # Topologically Sorted Source Nodes: [iadd], Original ATen: [aten.slice]
        buf52 = torch.ops.aten.slice.Tensor(buf51, 2, 0, 4)
        buf53 = buf52
        # Topologically Sorted Source Nodes: [], Original ATen: []
        buf54 = torch.ops.aten.slice_scatter.default(buf51, buf53, 2, 0, 4)
        del buf51
        del buf52
        del buf53
        buf55 = buf54
        del buf54
        # Topologically Sorted Source Nodes: [out], Original ATen: [aten._fft_c2r]
        buf56 = torch.ops.aten._fft_c2r.default(buf55, [2], 2, 8)
        del buf55
        buf57 = buf56
        del buf56
        # Topologically Sorted Source Nodes: [], Original ATen: [aten.transpose]
        buf58 = torch.ops.aten.permute.default(buf20, [0, 2, 1])
        buf59 = buf58
        # Topologically Sorted Source Nodes: [], Original ATen: [aten._conj]
        buf60 = torch.ops.aten._conj.default(buf59)
        buf61 = buf60
    return (reinterpret_tensor(buf57, (4, 4, 4), (32, 8, 1), 0), buf4, buf61, )


def benchmark_compiled_module(times=10, repeat=10):
    from torch._dynamo.testing import rand_strided
    from torch._inductor.utils import print_performance
    primals_1 = rand_strided((4, 4, 4), (16, 4, 1), device='cuda:0', dtype=torch.float32)
    primals_2 = rand_strided((4, 4, 4, 2), (32, 8, 2, 1), device='cuda:0', dtype=torch.float32)
    primals_3 = rand_strided((4, 4, 2), (8, 2, 1), device='cuda:0', dtype=torch.float32)
    fn = lambda: call([primals_1, primals_2, primals_3])
    return print_performance(fn, times=times, repeat=repeat)


if __name__ == "__main__":
    from torch._inductor.wrapper_benchmark import compiled_module_main
    compiled_module_main('None', benchmark_compiled_module)

import torch


class FourierConv1d(torch.nn.Module):

    def __init__(self, in_channels, out_channels, size, bias=True, periodic
        =False):
        super(FourierConv1d, self).__init__()
        self.in_channels = in_channels
        self.out_channels = out_channels
        if not periodic:
            self.size = size
        else:
            self.size = size // 2
        self.weights = torch.nn.Parameter(torch.view_as_real(1 / (
            in_channels * out_channels) * torch.rand(in_channels,
            out_channels, self.size, dtype=torch.cfloat)))
        self.biases = torch.nn.Parameter(torch.view_as_real(1 /
            out_channels * torch.rand(out_channels, self.size, dtype=torch.
            cfloat)))
        self.bias = bias
        self.periodic = periodic

    def forward(self, x):
        if not self.periodic:
            padding = self.size
            x = torch.nn.functional.pad(x, [0, padding])
        x_ft = torch.fft.rfft(x)
        out_ft = torch.zeros_like(x_ft)
        out_ft[:, :, :self.size] = torch.einsum('bix,iox->box', x_ft[:, :,
            :self.size], torch.view_as_complex(self.weights))
        if self.bias:
            out_ft[:, :, :self.size] += torch.view_as_complex(self.biases)
        out = torch.fft.irfft(out_ft, n=x.size(-1))
        if not self.periodic:
            out = out[..., :-padding]
        return out


def get_inputs():
    return [torch.rand([4, 4, 4])]


def get_init_inputs():
    return [[], {'in_channels': 4, 'out_channels': 4, 'size': 4}]

import torch
from torch import device
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_poi_fused_constant_pad_nd_0(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 8
    x1 = xindex // 8
    x2 = xindex
    tmp0 = x0
    tmp1 = tl.full([1], 4, tl.int64)
    tmp2 = tmp0 < tmp1
    tmp3 = tl.load(in_ptr0 + (x0 + 4 * x1), tmp2 & xmask, other=0.0)
    tl.store(out_ptr0 + x2, tmp3, xmask)


@triton.jit
def triton_poi_fused_add_1(in_ptr0, in_ptr1, out_ptr0, xnumel, XBLOCK: tl.
    constexpr):
    xnumel = 128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 8
    x3 = xindex // 8
    x4 = xindex % 32
    x5 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 10 * x3), xmask)
    tmp1 = tl.load(in_ptr1 + x4, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(out_ptr0 + x5, tmp2, xmask)


def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 4), (16, 4, 1))
    assert_size_stride(primals_2, (4, 4, 4, 2), (32, 8, 2, 1))
    assert_size_stride(primals_3, (4, 4, 2), (8, 2, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 4, 8), (32, 8, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_constant_pad_nd_0[grid(128)](primals_1, buf0, 128,
            XBLOCK=128, num_warps=4, num_stages=1)
        del primals_1
        buf1 = torch.ops.aten._fft_r2c.default(buf0, [2], 0, True)
        buf2 = buf1
        del buf1
        buf3 = torch.ops.aten.full.default([4, 4, 5], 0, dtype=torch.
            complex64, layout=torch.strided, device=device(type='cuda',
            index=0), pin_memory=False)
        buf4 = buf3
        del buf3
        buf5 = torch.ops.aten.slice.Tensor(buf2, 2, 0, 4)
        buf6 = buf5
        buf7 = torch.ops.aten.view_as_complex.default(primals_2)
        buf8 = buf7
        buf9 = torch.ops.aten.unsqueeze.default(buf6, 3)
        buf10 = buf9
        buf11 = torch.ops.aten.permute.default(buf10, [0, 3, 2, 1])
        buf12 = buf11
        buf13 = torch.ops.aten.unsqueeze.default(buf8, 3)
        buf14 = buf13
        buf15 = torch.ops.aten.permute.default(buf14, [3, 1, 2, 0])
        buf16 = buf15
        buf17 = torch.ops.aten.permute.default(buf12, [2, 0, 3, 1])
        buf18 = buf17
        buf19 = torch.ops.aten.reshape.default(buf18, [4, 4, 4])
        buf20 = buf19
        buf21 = torch.ops.aten.permute.default(buf16, [2, 3, 1, 0])
        buf22 = buf21
        buf23 = torch.ops.aten.reshape.default(buf22, [4, 4, 4])
        buf24 = buf23
        buf25 = torch.ops.aten.bmm.default(buf20, buf24)
        del buf13
        del buf14
        del buf15
        del buf16
        del buf21
        del buf22
        del buf23
        del buf24
        del buf7
        del buf8
        del primals_2
        buf26 = buf25
        del buf25
        buf27 = torch.ops.aten.reshape.default(buf26, [4, 4, 1, 4])
        buf28 = buf27
        buf29 = torch.ops.aten.permute.default(buf28, [1, 3, 0, 2])
        buf30 = buf29
        buf31 = torch.ops.aten.reshape.default(buf30, [4, 4, 4])
        buf32 = buf31
        buf33 = torch.ops.aten.slice.Tensor(buf4, 2, 0, 4)
        buf34 = buf33
        buf35 = torch.ops.aten.copy.default(buf34, buf32)
        del buf26
        del buf27
        del buf28
        del buf29
        del buf30
        del buf31
        del buf32
        buf36 = buf35
        del buf35
        buf37 = torch.ops.aten.slice_scatter.default(buf4, buf36, 2, 0, 4)
        del buf36
        buf38 = buf37
        del buf37
        buf39 = torch.ops.aten.view_as_complex.default(primals_3)
        buf40 = buf39
        buf41 = torch.ops.aten.slice.Tensor(buf38, 2, 0, 4)
        buf42 = buf41
        buf43 = torch.ops.aten.view.dtype(buf42, torch.float32)
        buf44 = buf43
        buf45 = torch.ops.aten.view.dtype(buf40, torch.float32)
        buf46 = buf45
        buf47 = reinterpret_tensor(buf0, (4, 4, 4, 2), (32, 8, 2, 1), 0)
        del buf0
        triton_poi_fused_add_1[grid(128)](buf44, buf46, buf47, 128, XBLOCK=
            128, num_warps=4, num_stages=1)
        del buf39
        del buf40
        del buf41
        del buf42
        del buf43
        del buf44
        del buf45
        del buf46
        del primals_3
        buf48 = torch.ops.aten.view.dtype(reinterpret_tensor(buf47, (4, 4, 
            8), (32, 8, 1), 0), torch.complex64)
        buf49 = buf48
        buf50 = torch.ops.aten.slice_scatter.default(buf38, buf49, 2, 0, 4)
        del buf38
        del buf47
        del buf48
        del buf49
        buf51 = buf50
        del buf50
        buf52 = torch.ops.aten.slice.Tensor(buf51, 2, 0, 4)
        buf53 = buf52
        buf54 = torch.ops.aten.slice_scatter.default(buf51, buf53, 2, 0, 4)
        del buf51
        del buf52
        del buf53
        buf55 = buf54
        del buf54
        buf56 = torch.ops.aten._fft_c2r.default(buf55, [2], 2, 8)
        del buf55
        buf57 = buf56
        del buf56
        buf58 = torch.ops.aten.permute.default(buf20, [0, 2, 1])
        buf59 = buf58
        buf60 = torch.ops.aten._conj.default(buf59)
        buf61 = buf60
    return reinterpret_tensor(buf57, (4, 4, 4), (32, 8, 1), 0), buf4, buf61


class FourierConv1dNew(torch.nn.Module):

    def __init__(self, in_channels, out_channels, size, bias=True, periodic
        =False):
        super(FourierConv1dNew, self).__init__()
        self.in_channels = in_channels
        self.out_channels = out_channels
        if not periodic:
            self.size = size
        else:
            self.size = size // 2
        self.weights = torch.nn.Parameter(torch.view_as_real(1 / (
            in_channels * out_channels) * torch.rand(in_channels,
            out_channels, self.size, dtype=torch.cfloat)))
        self.biases = torch.nn.Parameter(torch.view_as_real(1 /
            out_channels * torch.rand(out_channels, self.size, dtype=torch.
            cfloat)))
        self.bias = bias
        self.periodic = periodic

    def forward(self, input_0):
        primals_2 = self.weights
        primals_3 = self.biases
        primals_1 = input_0
        output = call([primals_1, primals_2, primals_3])
        return output[0]
