Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import torch
import numpy as np
import matplotlib.pyplot as plt
offsets = [torch.zeros(3), torch.tensor([1, 0, 0]), torch.tensor([1, 0, 0]), torch.tensor([1, 0, 0])]
Rs = [torch.eye(3)[:, 0:2] for _ in range(len(offsets))]
for i in range(len(Rs)-1):
Rs[i] = Rs[i].requires_grad_()
def get_positions(offsets, Rs):