error
78_conv_transposed_2D_asymmetric_input_asymmetric_kernel___padded__.py
started
2026-05-03T00:04:25Z
reference PyTorch source (the prompt the agent sees)
import torch
import torch.nn as nn
class Model(nn.Module):
"""
Performs a 2D transposed convolution operation with asymmetric input and kernel, with optional padding.
Args:
in_channels (int): Number of channels in the input tensor.
out_channels (int): Number of channels produced by the convolution.
kernel_size (tuple): Size of the convolution kernel (height, width).
stride (tuple, optional): Stride of the convolution (height, width). Defaults to (1, 1).
padding (tuple, optional): Padding applied to the input (height, width). Defaults to (0, 0).
bias (bool, optional): If `True`, adds a learnable bias to the output. Defaults to `False`.
"""
def __init__(self, in_channels: int, out_channels: int, kernel_size: tuple, stride: tuple = (1, 1), padding: tuple = (0, 0), bias: bool = False):
super(Model, self).__init__()
self.conv_transpose2d = nn.ConvTranspose2d(in_channels, out_channels, kernel_size, stride=stride, padding=padding, bias=bias)
def forward(self, x: torch.Tensor) -> torch.Tensor:
"""
Performs the 2D transposed convolution.
Args:
x (torch.Tensor): Input tensor of shape (batch_size, in_channels, height, width).
Returns:
torch.Tensor: Output tensor of shape (batch_size, out_channels, height_out, width_out).
"""
return self.conv_transpose2d(x)
# Test code
batch_size = 8
in_channels = 32
out_channels = 32
kernel_size = (3, 7)
height = 512
width = 1024
stride = (1, 1)
padding = (1, 3)
def get_inputs():
x = torch.rand(batch_size, in_channels, height, width)
return [x]
def get_init_inputs():
return [in_channels, out_channels, kernel_size, stride, padding]turn 07200.0s turn · 7200.0s LLM · 0.0s tools
feedbackLLM call failed: _WorkItemTimeout: work item exceeded soft timeout budget