YouTip LogoYouTip

Pytorch Torch Quantized_Max_Pool1D

# -- Learning is not just technology, but also a dream!\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n

PyTorch Tutorial

\\n\\n

PyTorch TutorialPyTorch IntroductionPyTorch InstallationPyTorch BasicsPyTorch TensorPyTorch Neural Network BasicsPyTorch First Neural NetworkPyTorch Dataset and DataLoaderPyTorch Linear RegressionPyTorch Convolutional Neural NetworkPyTorch Recurrent Neural NetworkPyTorch DatasetsPyTorch TransformsPyTorch torchPyTorch torch.nnTransformer ModelPyTorch TransformerPyTorch torch.optimPyTorch torchvisionPyTorch Model DeploymentPyTorch Model Saving and LoadingPyTorch Image ClassificationPyTorch Text Sentiment AnalysisPyTorch AutogradPyTorch GPU / CUDA AccelerationPyTorch Loss FunctionsPyTorch Learning Rate SchedulerPyTorch Transfer LearningPyTorch Batch NormalizationPyTorch LSTM / GRUPyTorch EmbeddingPyTorch GANPyTorch AutoencoderPyTorch Model Evaluation and DebuggingPyTorch torchtextPyTorch AMPPyTorch TorchScript/ONNX ExportPyTorch Distributed TrainingPyTorch Attention Mechanism

\\n\\n

Next PyTorch Data Transforms

\\n\\n

PyTorch torch.nn Reference ManualUp

\\n\\n

PyTorch torch.quantized_max_pool1d Function

\\n\\n
\\n\\n

Up PyTorch torch Reference Manual

\\n\\n

torch.quantized_max_pool1d is a function in PyTorch used to perform one-dimensional max pooling operations on quantized tensors. This function is used for downsampling in quantized convolutional neural networks.

\\n\\n

Function Definition

\\n\\n
torch.quantized_max_pool1d(input, kernel_size, stride, padding, dilation)\\n
\\n\\n

Parameter Description

\\n\\n
    \\n
  • input: Input quantized tensor (3D: batch x channel x length)
  • \\n
  • kernel_size: Pooling window size
  • \\n
  • stride: Stride (optional)
  • \\n
  • padding: Padding (optional)
  • \\n
  • dilation: Dilation (optional)
  • \\n
\\n\\n
\\n\\n

Usage Example

\\n\\n

Example

\\n\\n
import torch\\n\\n# Create quantized input tensor (batch=1, channel=1, length=10)\\n\\ninput= torch.quantize_per_tensor(torch.randn(1,1,10), scale=0.1, zero_point=0, dtype=torch.quint8)\\n\\n# Perform quantized max pooling\\n\\n output = torch.quantized_max_pool1d(input, kernel_size=3, stride=2, padding=1)\\n\\nprint("Input Shape:",input.shape)\\n\\nprint("Output shape:", output.shape)\\n
\\n\\n

Output result:

\\n\\n
Input Shape: torch.Size([1, 1, 10])Output shape: torch.Size([1, 1, 5])\\n
\\n\\n
\\n\\n

Up PyTorch torch Reference Manual

\\n\\n

Next PyTorch Data Transforms

\\n\\n

PyTorch torch.nn Reference ManualUp

\\n\\n

ByteArk Coding Plan ByteArk Coding Plan supports major large models like Doubao, GLM, DeepSeek, Kimi, MiniMax, etc., with official direct supply ensuring stability and reliability. Configuration Guide Β₯9.9/month Sign Up Now

\\n\\n

iFlytek Coding Plan iFlytek Starry Coding Plan includes free model call quotas for DeepSeek, GLM, Kimi, MiniMax, providing an all-in-one platform for experience and deployment. Configuration Guide Β₯3.9/month Sign Up Now

← Pytorch Torch Rad2DegPytorch Torch Quantize_Per_Ten β†’