1 min read

SageMaker Inference

SageMaker Inference
Photo by Kevin Ku / Unsplash

Sagemaker inference provides 4 different types of inference: batch, serverless, real-time, and asynchronous.

This is some basic pytorch code:

import torch
from torch import nn
from torch.utils.data import DataLoader
from torchvision import datasets
from torchvision.transforms import ToTensor

# Download training data from open datasets.
training_data = datasets.FashionMNIST(
    root="data",
    train=True,
    download=True,
    transform=ToTensor(),
)

# Download test data from open datasets.
test_data = datasets.FashionMNIST(
    root="data",
    train=False,
    download=True,
    transform=ToTensor(),
)