Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use key to access column in computation #55

Merged
merged 1 commit into from
Jul 4, 2024
Merged

Conversation

mhchia
Copy link
Member

@mhchia mhchia commented Jul 4, 2024

Columns are accessed through their column name. E.g.

def user_computation(s: State, data: Args) -> torch.Tensor:
    # Compute the median of the first column
    median1 = s.median(data['column1'])
    median2 = s.median(data['column2'])
    return s.mean(torch.cat((median1.unsqueeze(0), median2.unsqueeze(0))).reshape(1,-1,1))

@mhchia mhchia merged commit d4c30d1 into main Jul 4, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant