- \\n
- Home \\n
- HTML \\n
- JavaScript \\n
- CSS \\n
- Vue \\n
- React \\n
- Python3 \\n
- Java \\n
- C \\n
- C++ \\n
- C# \\n
- AI \\n
- Go \\n
- SQL \\n
- Linux \\n
- VS Code \\n
- Bootstrap \\n
- Git \\n
- Local Bookmarks \\n
- \\n
- Vue3 Tutorial \\n
- Vue2 Tutorial \\n
- \\n
- Bootstrap3 \\n
- Bootstrap4 \\n
- Bootstrap5 \\n
- \\n
- Machine Learning \\n
- PyTorch \\n
- TensorFlow \\n
- Sklearn \\n
- NLP \\n
- AI Agent \\n
- Ollama \\n
- Coding Plan \\n
PyTorch Tutorial
\\n\\nPyTorch 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\\n\\nPyTorch torch.nn Reference Manual
PyTorch torch.quantized_max_pool1d Function
\\n\\n\\n\\n
PyTorch torch Reference Manual
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.
Function Definition
\\n\\ntorch.quantized_max_pool1d(input, kernel_size, stride, padding, dilation)\\n\\n\\nParameter Description
\\n\\n- \\n
input: Input quantized tensor (3D: batch x channel x length) \\nkernel_size: Pooling window size \\nstride: Stride (optional) \\npadding: Padding (optional) \\ndilation: Dilation (optional) \\n
\\n\\n
Usage Example
\\n\\nExample
\\n\\nimport 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\\nOutput result:
\\n\\nInput Shape: torch.Size([1, 1, 10])Output shape: torch.Size([1, 1, 5])\\n\\n\\n\\n\\n
PyTorch torch Reference Manual
YouTip