Complete the code to import TensorFlow library.
import [1] as tf
TensorFlow is imported using the name 'tensorflow'.
Complete the code to create a tensor with PyTorch.
import torch x = [1]([1, 2, 3])
PyTorch creates tensors using torch.tensor() with a lowercase 't'.
Fix the error in the TensorFlow code to create a constant tensor.
import tensorflow as tf x = tf.[1]([1, 2, 3])
TensorFlow creates constant tensors using tf.constant().
Fill both blanks to define a simple linear model in PyTorch.
import torch.nn as nn model = nn.[1](in_features=10, [2]=1)
PyTorch linear layers are created with nn.Linear and require 'in_features' and 'out_features' parameters.
Fill all three blanks to compile and train a TensorFlow model.
model.compile(optimizer='[1]', loss='[2]', metrics=['[3]']) model.fit(x_train, y_train, epochs=5)
Common TensorFlow compile parameters include 'adam' optimizer, 'sparse_categorical_crossentropy' loss, and 'accuracy' metric.
