Skip to content

Instantly share code, notes, and snippets.

View soumith's full-sized avatar

Soumith Chintala soumith

View GitHub Profile
import os
import threading
from flask import Flask
import socketio
from flask_cors import cross_origin, CORS
import dlevent
import logging
import json
import random
try:
version: 0.2.1
command: /home/bluebox/miniconda3/bin/ghstack
status: e01eae026 "use event dispatcher in dashboard and agents"
$ git remote get-url origin
Using selector: EpollSelector
git@github.com:fairinternal/minecraft.git
# POST https://api.github.com/graphql
Request GraphQL query:
Fatal Python error: Aborted
Thread 0x00007fdbce852700 (most recent call first):
File "/usr/lib/python3.6/http/client.py", line 368 in begin
File "/usr/lib/python3.6/http/client.py", line 1345 in getresponse
File "/usr/lib/python3.6/xmlrpc/client.py", line 1170 in single_request
File "/usr/lib/python3.6/xmlrpc/client.py", line 1154 in request
File "/usr/lib/python3.6/xmlrpc/client.py", line 1458 in __request
File "/usr/lib/python3.6/xmlrpc/client.py", line 1112 in __call__
File "/home/soumith/pyrobot_catkin_ws/src/ros_comm/clients/rospy/src/rospy/impl/tcpros_base.py", line 89 in _is_use_tcp_keepalive
Fatal Python error: Aborted
Thread 0x00007fde70f24700 (most recent call first):
File "/usr/lib/python3.6/http/client.py", line 1221 in putheader
File "/usr/lib/python3.6/xmlrpc/client.py", line 1309 in send_content
File "/usr/lib/python3.6/xmlrpc/client.py", line 1279 in send_request
File "/usr/lib/python3.6/xmlrpc/client.py", line 1166 in single_request
File "/usr/lib/python3.6/xmlrpc/client.py", line 1154 in request
File "/usr/lib/python3.6/xmlrpc/client.py", line 1452 in __request
File "/usr/lib/python3.6/xmlrpc/client.py", line 1112 in __call__
# *****************************************************************************
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
### First, tokenize the input
import torch
tokenizer = torch.hub.load('huggingface/pytorch-transformers', 'tokenizer', 'bert-base-cased', do_basic_tokenize=False)
text_1 = "Who was Jim Henson ?"
text_2 = "Jim Henson was a puppeteer"
# Tokenized input
indexed_tokens = tokenizer.encode(text_1, text_2, add_special_tokens=True)
### Get the hidden states computed by `BertModel`
import numpy as np
import os
import time
import warnings
import pickle
# from accimage import Image
from PIL import Image
import io
try:
#include <torch/torch.h>
#include <iostream>
#include <ATen/Parallel.h>
#include <ATen/ATen.h>
// using namespace at;
using namespace torch;
void submodular_select(Tensor candidate_points, Tensor features_done, Tensor features)
{
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
class simpnet_imgnet_drpall(nn.Module):
"""
args: classes
scale
network_idx (0,1):simpnet5m, simpnet8m
op_version_set = 0
def forward(self,
input_1: Tensor) -> Tensor:
input_2 = torch._convolution(input_1, self.features.conv0.weight, None, [2, 2], [3, 3], [1, 1], False, [0, 0], 1, False, False, True)
input_3 = torch.batch_norm(input_2, self.features.norm0.weight, self.features.norm0.bias, self.features.norm0.running_mean, self.features.norm0.running_var, False, 0., 1.0000000000000001e-05, True)
input_4 = torch.threshold_(input_3, 0., 0.)
input_5, _0 = torch.max_pool2d_with_indices(input_4, [3, 3], [2, 2], [1, 1], [1, 1], False)
input_6 = torch.batch_norm(input_5, self.features.denseblock1.denselayer1.norm1.weight, self.features.denseblock1.denselayer1.norm1.bias, self.features.denseblock1.denselayer1.norm1.running_mean, self.features.denseblock1.denselayer1.norm1.running_var, False, 0., 1.0000000000000001e-05, True)
input_7 = torch.threshold_(input_6, 0., 0.)
input_8 = torch._convolution(input_7, self.features.denseblock1.denselayer1.conv1.weight, None, [1, 1], [0, 0], [1, 1], False, [0, 0],