As you’ve already read, there are not placeholders in PyTorch and you can directly use tensors (similar to how you would use numpy). I don’t know why the tf.placeholder is assigned to self.X, but your translated code in PyTorch should just accept an input tensor in the forward(self, x) method and could use x directly in all operations.