<The previous article in this series | The table of contents of this series | The next article in this series>
The error message seems not correct, and the underlying rule seems not reasonable. . . . Anyway, let me solve the problem.
Topics
About:
C++
The table of contents of this article
- Starting Context
- Target Context
- Orientation
- Main Body
- 1: Meeting an «expected primary-expression before ‘>’ token» C++ GCC Compile Error
- 2: Trying to Solve the Compile Error
- 3: Solving the Compile Error, and Some Complaints
Starting Context
- The reader has a basic knowledge on C++.
Target Context
- The reader will know how to solve an «expected primary-expression before ‘» «>» or whatever «‘ token» C++ GCC compile error.
Orientation
There is an article that clarifies the concept of template in C++.
There is an article that clarifies the distinction between definition and declaration in C++.
Main Body
1: Meeting an «expected primary-expression before ‘>’ token» C++ GCC Compile Error
Hypothesizer 7
«expected primary-expression before ‘>’ token»? What is that supposed to mean? . . .
Well, I am trying to compile this piece of C++ code with GCC (note that I put function template body declarations (which should not be called «definitions») into ‘tpp’ files).
theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassE.hpp
@C++ Source Code
#ifndef __theBiasPlanet_coreUtilitiesTests_templatesTest1_ClassE_hpp__#define __theBiasPlanet_coreUtilitiesTests_templatesTest1_ClassE_hpp__namespace theBiasPlanet {namespace coreUtilitiesTests {namespace templatesTest1 {class ClassE {public:ClassE ();virtual ~ClassE ();template <typename U> U methodE0 (U const & a_argument0) const;};}}}#endif
theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassE.cpp
@C++ Source Code
#include "theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassE.hpp"namespace theBiasPlanet {namespace coreUtilitiesTests {namespace templatesTest1 {ClassE::ClassE () {}ClassE::~ClassE () {}}}}
theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassE.tpp
@C++ Source Code
#include "theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassE.hpp"namespace theBiasPlanet {namespace coreUtilitiesTests {namespace templatesTest1 {template <typename U> U ClassE::methodE0 (U const & a_argument0) const {return a_argument0;}}}}
theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassF.hpp
@C++ Source Code
#ifndef __theBiasPlanet_coreUtilitiesTests_templatesTest1_ClassF_hpp__#define __theBiasPlanet_coreUtilitiesTests_templatesTest1_ClassF_hpp__#include "theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassE.hpp"namespace theBiasPlanet {namespace coreUtilitiesTests {namespace templatesTest1 {class ClassF {public:template <typename U> static void methodF0 (U const & a_argument0);static void methodF1 (ClassE const & a_argument0);};}}}#endif
theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassF.cpp
@C++ Source Code
#include "theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassF.hpp"#include <string>namespace theBiasPlanet {namespace coreUtilitiesTests {namespace templatesTest1 {void ClassF::methodF1 (ClassE const & a_argument0) {a_argument0.methodE0 <std::string> ("aaa");}}}}
theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassF.tpp
@C++ Source Code
#include "theBiasPlanet/coreUtilitiesTests/templatesTest1/ClassF.hpp"#include <string>namespace theBiasPlanet {namespace coreUtilitiesTests {namespace templatesTest1 {template <typename U> void ClassF::methodF0 (U const & a_argument0) {a_argument0.methodE0 <std::string> ("aaa");}}}}
The ‘>’ token mentioned in the message points to the ‘>’ of ‘a_argument0.methodE0 <std::string> («aaa»);’.
In the first place, what, the hell, is «primary-expression»?
This page claims that it means a building block of more complex expressions. . . . I do not know . . .
I do not know because then, I cannot imagine any expression that is not a primary-expression. In fact, what is an expression that cannot be any building block of any more complex expression? . . . For example, an expression, ‘1 + 2’, can be a building block of ‘1 + 2 + 3’; so it should be a primary-expression, although the page does not seem to admit ‘1 + 2’ to be a primary-expression . . .
Anyway, I thank that the page explicitly states that any class name like «MyClass» and «A::B» or any «template id» like «A<int>» is a primary-expression. So, ‘std::string’ is definitely a primary-expression, is it not? . . . The some other documents I have found seem to agree that it is really a primary-expression.
Well, the thing that is before the ‘>’ in my code is . . . «std::string», an assured primary-expression. . . . Mr. compiler, a primary-expression seems to be already there . . .
2: Trying to Solve the Compile Error
Hypothesizer 7
The sloppiness of the message aside, that message was a reminiscent of my past struggle with template.
At that time, I had to put ‘typename’ in order to explicitly teach the compiler that a type name was a type name, which was for assuring that the ‘<‘-‘>’ pair was for template parameterization, not for comparing things.
Well, does the compiler require ‘typename’? How about this?
@C++ Source Code
a_argument0.methodE0 <typename std::string> ("aaa");"
Nope.
Why? The compiler should now know that the ‘>’ is not any comparison operator, should not?
3: Solving the Compile Error, and Some Complaints
Hypothesizer 7
In fact, there seems to be a rule that any template member on any template-type dependent qualification has to be explicitly declared as a template with ‘.template’.
Well, in my case, ‘methodE0 <U>’ is a template member of ‘a_argument0’, which is a template-type dependent qualification (certainly, it is the qualification and dependent on the template type, ‘U’), so, it has to be ‘a_argument0.template methodE0 <std::string> («aaa»)’.
Hmm . . . , certainly, that has solved the problem, but is such a rule reasonable? . . . I mean, I understand that the rule exists, but I do not understand why the rule is not foolish.
You know, I am not any person that is happy just because a problem has been solved without any satisfactory explanation; I want an explanation why such a rule is necessary.
For example, this (which already exists in the above code) does not cause the error.
@C++ Source Code
void ClassF::methodF1 (ClassE const & a_argument0) {a_argument0.methodE0 <std::string> ("aaa");}
That is because, of course, the qualification is independent of any template type, escaping the premise of the rule.
However, I do not see any reason why the flagged line is more a difficulty than the passed line is, for the compiler. . . . You know, the template itself is never compiled, but instantiations of the template are compiled, right? In fact, ‘void ClassF::methodF0 <ClassE> (ClassE const & a_argument0)’ should be no different from ‘void ClassF::methodF1 (ClassE const & a_argument0)’ except the method name.
I understand that a rule that disambiguates ‘<‘ and ‘>’ may be required, but I doubt that the present rule is wisely chosen.
If there is a reasonable necessity for the rule to exist, an understandable explanation would be nice. If the explanation is «You must just obey because I said so!», I would regard such a rule tyrannical, and foolish.
References
<The previous article in this series | The table of contents of this series | The next article in this series>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
#include <conio.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_SIZE 30 typedef struct User_t { char *login; char *password; char *name; char *sex; int age; int id; float height; float weight; }User; /*+*/void clean_memory(User** users, unsigned size) { int i; for(i=0;i<size;i++) { free((*users)[size].login); free((*users)[size].password); free((*users)[size].name); free((*users)[size].sex); } free(*users); *users = NULL; } /*+*/void output_f(User** users) { int value,n,i; printf ("1 - output single data"); printf ("2 - output all data"); printf ("select an action : n"); scanf ("%d",&n); switch(n) { case 1: printf ("Input user's id"); scanf ("%d",value); printf ("{id: %d, login: "%s", password: "%s"}n{ name: "%s", sex: "%s", age: %d}n { height:%f, weight:%f}n", (*users)[value].id,(*users)[value].login,(*users)[value].password,(*users)[value].name,(*users)[value].sex, (*users)[value].age,(*users)[value].height,(*users)[value].weight); break; case 2: for(i=0;i<value;i++) printf("{id: %d, login: "%s", password: "%s"}n{ name: "%s", sex: "%s", age: %d}n { height:%f, weight:%f}n", (*users)[value].id, (*users)[value].login, (*users)[value].password,(*users)[value].name,(*users)[value].sex, (*users)[value].age,(*users)[value].height,(*users)[value].weight); break; default : break; } } /*+*/void include_f(User** users, unsigned size) { char buffer[128]; bool sex; printf("Input user's loginn"); scanf("%127s", buffer); (users*)[size].login = (char*) malloc(strlen(buffer) + 1); strcpy((users*)[size].login, buffer); printf("Input user's passwordn"); scanf("%127s", buffer); (users*)[size].password = (char*) malloc(strlen(buffer) + 1); strcpy((users*)[size].password, buffer); printf("Input user's namen"); scanf("%127s", buffer); (users*)[size].name = (char*) malloc(strlen(buffer) + 1); strcpy((users*)[size].name, buffer); printf("Input user's sex(0-female or 1-male)n"); scanf("%d",sex); switch(sex) { case 0: (users*)[size].sex=(char*) malloc(strlen("female")+1); strcpy((users*)[size].sex, buffer); break; case 1: (users*)[size].sex=(char*) malloc(strlen("male")+1); strcpy((users*)[size].sex, buffer); break; default: break; } printf("Input user's agen"); scanf("%d",(users*)[size].age); printf("Input user's heightn"); scanf("%f",(users*)[size].height); printf("Input user's weightn"); scanf("%f",(users*)[size].weight); } /*+*/void delete_f(User** users) { int value; printf("Input user's id"); scanf("%d",value); free((*users)[value].login); free((*users)[value].password); free((*users)[value].name); free((*users)[value].sex); users[value] = NULL; } void search_f(User** users) { } void sort_f(User** users) { int value; printf("set the sort task:"); printf("1 - age n"); printf("2 - height n"); printf("3 - weight n"); printf("4 - sex (male->female) n"); printf("5 - ABC(A->Z) n"); scanf("%d",value); switch(value) { case 1: break; case 2: break; case 3: break; case 4: break; case 5: break; default : printf("input right valuen"); break; } } /*+*/void edit_f(User** users) { int value; bool sex; char buffer[128]; printf ("Input user's id"); scanf ("%d",value); printf ("Input user's loginn"); scanf("%127s", buffer); (users*)[value].login = (char*) malloc(strlen(buffer) + 1); strcpy((users*)[value].login, buffer); printf("Input user's passwordn"); scanf("%127s", buffer); (users*)[value].password = (char*) malloc(strlen(buffer) + 1); strcpy((users*)[value].password, buffer); printf("Input user's namen"); scanf("%127s", buffer); (users*)[value].name = (char*) malloc(strlen(buffer) + 1); strcpy((users*)[value].name, buffer); printf("Input user's sex(0-female or 1-male)n"); scanf("%d",sex); switch(sex) { case 0: (users*)[value].sex=(char*) malloc(strlen("female")+1); strcpy((users*)[value].sex, "female"); break; case 1: (users*)[value].sex=(char*) malloc(strlen("male")+1); strcpy((users*)[value].sex, "male"); break; default: break; } printf("Input user's agen"); scanf("%d",(users*)[value].age); printf("Input user's heightn"); scanf("%f",(users*)[value].height); printf("Input user's weightn"); scanf("%f",(users*)[value].weight); } /*+*/void input_f(User** users,unsigned size) { unsigned i; char buffer[128]; bool sex; for(i=0;i<size;i++) { (*users)->id=i; printf("Input user's #%dnlogin",i); scanf("%127s", buffer); (*users)[i].login = (char*) malloc(strlen(buffer) + 1); strcpy((*users)[i].login, buffer); printf("Input user's passwordn"); scanf("%127s", buffer); (*users)[i].password = (char*) malloc(strlen(buffer) + 1); strcpy((*users)[i].password, buffer); printf("Input user's nnamen"); scanf("%127s", buffer); (*users)[i].name = (char*) malloc(strlen(buffer) + 1); strcpy((*users)[i].name, buffer); printf("Input user's sex(0-female or 1-male)n"); scanf("%d",sex); switch(sex) { case 0: (*users)[i].sex=(char*) malloc(strlen("female")+1); strcpy((*users)[i].sex, "female"); break; case 1: (*users)[i].sex=(char*) malloc(strlen("male")+1); strcpy((*users)[i].sex, "male"); break; default: break; } printf("Input user's agen"); scanf("%d",(*users)[i].age); printf("Input user's heightn"); scanf("%f",(*users)[i].height); printf("Input user's weightn"); scanf("%f",(*users)[i].weight); } } int main () { User *users = NULL; unsigned size,value; bool program=true; printf("Input number of usersn"); scanf("%d",&size); size = size <= MAX_SIZE? size: MAX_SIZE; users = (User*) malloc((size+3) * sizeof(User)); /*+*/printf("1 - inputn"); /*+*/printf("2 - outputn"); /*+*/printf("3 - include (from the end )n"); /*+*/printf("4 - deleten"); printf("5 - searchn"); printf("6 - sortn"); /*+*/printf("7 - editn"); /*+*/printf("8 - exitn"); while (program) { printf("select an action : n"); scanf("%d", value); switch(value) { case 1: input_f(&users,size); break; case 2: output_f(&users); break; case 3: include_f(&users,size); size++; break; case 4: delete_f(&users); break; case 5: search_f(&users); break; case 6: sort_f(&users); break; case 7: edit_f(&users); break; case 8: program=false; break; default: printf("input right valuen"); break; } } clean_memory(&users,size); return 0; } |

Continue reading to see where you might be getting wrong and how you can solve the issue.
Why Does the Expected Primary Expression Before Occur?
The expected primary expression before error occurs when your code doesn’t follow the correct syntax. The mistakes pointed out below are the ones that often take place when you are new to programming. However, a programmer in hurry might make the same mistakes.
So, here you go:
– You Are Specifying the Data Type With Function Argument
If your function call contains the data type along with the argument, then you’ll get an error.
Here is the problematic function call:
int addFunction(int num1, int num2)
{
int sum;
sum = num1 + num2;
return sum;
}
int main()
{
int result = addFunction(int 20, int 30);
}
– The Wrong Type of Arguments
Passing the wrong types of arguments can result in the same error. You can not pass a string to a function that accepts an argument of int data type.
int main()
{
int result = addFunction(string “cat”, string “kitten”);
}
– Issue With the Curly Braces Resulting in Expected Primary Expression Before }
Missing a curly bracket or adding an extra curly bracket usually results in the mentioned error.
– The Parenthesis Following the If Statement Don’t Contain an Expression
If the parenthesis in front of the if statement doesn’t contain an expression or the result of an expression, then the code won’t run properly. Consequently, you’ll get the stated error.
How To Fix the Given Error?
You can fix the “expected primary-expression before” error by using the solutions given below:
– Remove the Data Type That Precedes the Function Argument
Remove the data type from the parenthesis while calling a function to solve the error. Here is the correct way to call a function:
int main()
{
int result = addFunction(30, 90);
}
– Pass the Arguments of the Expected Data Type
Double-check the function definition and pass the arguments of the type that matches the data type of the parameters. It will ensure that you pass the correct arguments and kick away the error.
– Ensure The Equal Number of Opening and Closing Curly Brackets
Your program must contain an equal number of opening and closing curly brackets. Begin with carefully observing your code to see where you are doing the mistake.
– Add an Expression in the If Statement Parenthesis
The data inside the parenthesis following the if statement should be either an expression or the result of an expression. Even adding either true or false will solve the issue and eliminate the error.
FAQ
You can view latest topics and suggested topics that’ll help you as a new programmer.
– What Does It Mean When the Error Says “Expected Primary Expression Before Int” in C?
The “expected primary expression before int” error means that you are trying to declare a variable of int data type in the wrong location. It mostly happens when you forget to terminate the previous statement and proceed with declaring another variable.
– What Is a Primary Expression in C Language?
A primary expression is the basic element of a complex expression. The identifiers, literals, constants, names, etc are considered primary expressions in the C programming language.
– What Are the Types of Expressions?
The different types of expressions include arithmetic, character, and logical or relational expressions. An arithmetic expression returns an arithmetic value. A character expression gives back a character value. Similarly, a logical value will be the output of a logical or relational expression.
Conclusion
The above error revolves around syntax mistakes and can be solved easily with a little code investigation. The noteworthy points depicting the solutions have been written below to help you out in removing the error:
- Never mention the data type of parameters while calling a function
- Ensure that you pass the correct type of arguments to the given function
- You should not miss a curly bracket or add an extra one
- The if statement should always be used with the expressions, expression results, true, or false

- Author
- Recent Posts
Position Is Everything: Your Go-To Resource for Learn & Build: CSS,JavaScript,HTML,PHP,C++ and MYSQL.
|
|
“Expected primary-expression before ‘some‘ token” is one of the most common errors that you can experience in Arduino code. Arduino code is written in C++ with few additions here and there, so it is a C++ syntax error. There are multiple versions of this error, depends on what is it that you messed up. Some are easy to fix, some not so much.
Most of the times (but not always), the error occurs because you have missed something or put it at the wrong place. Be it a semicolon, a bracket or something else. It can be fixed by figuring out what is that you missed/misplaced and placing it at the right position. Let us walk through multiple versions of the error and how to fix them one by one.
We all like building things, don’t we? Arduino gives us the opportunity to do amazing things with electronics with simply a little bit of code. It is an open-source electronics platform. It is based on hardware and software which are easy to learn and use. If I were to explain in simple language what Arduino does – it takes an input from the user in different forms such as touch or light and turns it into an output such as running a motor. Actually, you can even post tweets on Twitter with Arduino.
Table of Contents
- How to fix “Expected Primary-Expression Before” error?
- Type 1: Expected primary-expression before ‘}’ token
- Type 2: Expected primary expression before ‘)’ token
- Type 3: Expected primary-expression before ‘enum’
- Type 4: Expected primary expression before ‘.’
- Type 5: Expected primary-expression before ‘word’
- Type 6: Expected primary-expression before ‘else’
- Conclusion
I’ll walk you through multiple examples of where the error can occur and how to possibly fix it. The codes that I use as examples in this article are codes that people posted on forums asking for a solution, so all credits of the code go to them. Let’s begin.
Type 1: Expected primary-expression before ‘}’ token
This error occurs when when the opening curly brackets ‘{‘ are not properly followed by the closing curly bracket ‘}’. To fix this, what you have to do is: check if all of your opening and closing curly brackets match properly. Also, check if you are missing any curly brackets. There isn’t much to this, so I’ll move on to the other types.
Type 2: Expected primary expression before ‘)’ token
Example 1: All credits to this thread. Throughout all of my examples, I will highlight the line which is causing the issue with red.
#include <Adafruit_NeoPixel.h>
#include <BlynkSimpleEsp8266.h>
#include <ESP8266WiFi.h>
#define PIN D1
#define NUMPIXELS 597
int red = 0;
int green = 0;
int blue = 0;
int game = 0;
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
///////////////////////////////////////////////////////////////////////////////////////////////////////////
void setup() {
Blynk.begin("d410a13b55560fbdfb3df5fe2a2ff5", "8", "12345670");
pixels.begin();
pixels.show();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
BLYNK_WRITE(V1) {
game = 1;
int R = param[0].asInt();
int G = param[1].asInt();
int B = param[2].asInt();
setSome(R, G, B);
}
BLYNK_WRITE(V2) {
if (param.asInt()==1) {
game = 2;
rainbow(uint8_t); // Rainbow
}
else {
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void loop()
{
Blynk.run();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void rainbow(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256; j++) {
for(i=0; i<NUMPIXELS; i++) {
pixels.setPixelColor(i, Wheel((i+j) & 255));
}
pixels.show();
delay(wait);
}
// delay(1);
}
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return pixels.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return pixels.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return pixels.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}BLYNK_WRITE(V3) {
if (param.asInt()) {
game = 3;
setAll(125, 47, 0); //candle
}
else {
}
}
BLYNK_WRITE(V4) {
game = 4;
int Bright = param.asInt();
pixels.setBrightness(Bright);
pixels.show();
}
BLYNK_WRITE(V5) {
if (param.asInt()) {
game = 5;
setAll(85, 0, 255);
}
else {
}
}
BLYNK_WRITE(V6) {
if (param.asInt()) {
game = 6;
oFF(red, green, blue);
// fullOff();
}
else {
}
}
BLYNK_WRITE(V7) {
if (param.asInt()) {
game = 7;
setAll(255, 0, 85);
}
else {
}
}
BLYNK_WRITE(V8) {
if (param.asInt()) {
game = 8;
setAll(90, 90, 90);
}
else {
}
}
BLYNK_WRITE(V9) {
if (param.asInt()) {
game = 9;
setAll(255, 130, 130);
}
else {
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void oFF(byte r, byte g, byte b) {
if (game == 1) {
offsome(r, g, b);
}
else if (game == 2) {
offall(r, g, b);
}
else if (game == 3) {
offall(r, g, b);
}
else if (game == 4) {
offall(r, g, b);
}
else if (game == 5) {
offall(r, g, b);
}
else if (game == 6) {
offall(r, g, b);
}
else if (game == 7) {
offall(r, g, b);
}
else if (game == 8) {
offall(r, g, b);
}
else if (game == 9) {
offall(r, g, b);
}
}
void offall(byte r, byte g, byte b) {
uint32_t x = r, y = g, z = b;
for (x; x > 0; x--) {
if( y > 0 )
y--;
if( z > 0 )
z--;
for(int i = 0; i < NUMPIXELS; i++ ) {
pixels.setPixelColor(i, pixels.Color(x, y, z));
}
pixels.show();
delay(0);
}
//delay(0);
}
void offsome(byte r, byte g, byte b) {
uint32_t x = r, y = g, z = b;
for (x; x > 0; x--) {
if( y > 0 )
y--;
if( z > 0 )
z--;
for(int i = 87; i < 214; i++ ) {
pixels.setPixelColor(i, pixels.Color(x, y, z));
}
for(int i = 385; i < 510; i++ ) {
pixels.setPixelColor(i, pixels.Color(x, y, z));
}
pixels.show();
delay(0);
}
}
void setAll(byte r, byte g, byte b) {
uint16_t x = 0, y = 0, z = 0;
for (x; x < r; x++) {
if( y < g )
y++;
if( z < b )
z++;
for(int i = 0; i < NUMPIXELS; i++ ) {
pixels.setPixelColor(i, pixels.Color(x, y, z));
}
pixels.show();
red = r;
green = g;
blue = b;
delay(0);
}
//delay(0);
}
void setSome(byte r, byte g, byte b) {
uint16_t x = 0, y = 0, z = 0;
for (x; x < r; x++) {
if( y < g )
y++;
if( z < b )
z++;
for(int i = 86; i < 212; i++ ) {
pixels.setPixelColor(i, pixels.Color(x, y, z));
}
for(int i = 385; i < 512; i++ ) {
pixels.setPixelColor(i, pixels.Color(x, y, z));
}
pixels.show();
red = r;
green = g;
blue = b;
delay(0);
}
//delay(0);
}
void fullOff() {
for(int i = 0; i < NUMPIXELS; i++ ) {
pixels.setPixelColor(i, pixels.Color(0, 0, 0));
}
pixels.show();
}
Solution 1:
The error occurs in this code because the rainbow function is supposed to have a variable as its argument, however the argument given here is ‘uint8_t’ which is not a variable.
BLYNK_WRITE(V2) {
if (param.asInt()==1) {
game = 2;
rainbow(uint8_t); // Rainbow
}
else {
}
}
Here all you have to do is define uint8_t as a variable first and assign it a value. The code will work after that.
Type 3: Expected primary-expression before ‘enum’
Example 1: All credits to this thread.
#include <iostream>
using namespace std;
int main()
{
enum userchoice
{
Toyota = 1,
Lamborghini,
Ferrari,
Holden,
Range Rover
};
enum quizlevels
{
Hardquestions = 1,
Mediumquestions,
Easyquestions
};
return 0;
}
Solution 1:
The “expected primary-expression before ‘enum’ ” error occurs here because the enum here has been defined inside a method, which is incorrect. The corrected code is:
#include <iostream>
using namespace std;
enum userchoice
{
Toyota = 1,
Lamborghini,
Ferrari,
Holden,
RangeRover
};
enum quizlevels
{
HardQuestions = 1,
MediumQuestions,
EasyQuestions
};
int main()
{
return 0;
}
Note: Another mistake has been fixed in this code i.e. the space in “Range Rover” variable. Variable names cannot contain spaces.
Type 4: Expected primary expression before ‘.’
Example 1: All credits go to this thread.
#include <iostream>
using std::cout;
using std::endl;
class square {
public:
double length, width;
square(double length, double width);
square();
~square();
double perimeter();
};
double square::perimeter() {
return 2*square.length + 2*square.width;
}
int main() {
square sq(4.0, 4.0);
cout << sq.perimeter() << endl;
return 0;
}
Solution 1: Here the error occurs because “square” is being used as an object, which it is not. Square is a type, and the corrected code is given below.
#include <iostream>
using std::cout;
using std::endl;
class square {
public:
double length, width;
square(double length, double width);
square();
~square();
double perimeter();
};
double square::perimeter() {
return 2*length + 2*width;
}
int main() {
square sq(4.0, 4.0);
cout << sq.perimeter() << endl;
return 0;
}
Type 5: Expected primary-expression before ‘word’
Example 1: All credits go to this thread.
#include <iostream>
#include <string>
using namespace std;
string userInput();
int wordLengthFunction(string word);
int permutation(int wordLength);
int main()
{
string word = userInput();
int wordLength = wordLengthFunction(string word);
cout << word << " has " << permutation(wordLength) << " permutations." << endl;
return 0;
}
string userInput()
{
string word;
cout << "Please enter a word: ";
cin >> word;
return word;
}
int wordLengthFunction(string word)
{
int wordLength;
wordLength = word.length();
return wordLength;
}
int permutation(int wordLength)
{
if (wordLength == 1)
{
return wordLength;
}
else
{
return wordLength * permutation(wordLength - 1);
}
}
Solution 1:
Here, they are incorrectly using string inside wordLengthFunction().
Fixing it is simple, simply replace
int wordLength = wordLengthFunction(string word);
by
int wordLength = wordLengthFunction(word);
Type 6: Expected primary-expression before ‘else’
Example 1: All credit goes to this thread.
// Items for sale:
// Gizmos - Product number 0-999
// Widgets - Product number 1000-1999
// doohickeys - Product number 2000-2999
// thingamajigs - Product number 3000-3999
// Product number >3999 = Invalid Item
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
float ProdNumb; // Product Number
double PrG; // Product Number for Gizmo
double NG; // Number of items
double PG; // Price of Item
double PrW; // Product Number for Widgets
double NW; // Number of items
double PW; // Price of Item
double PrD; // Product Number for Doohickeys
double ND ; // Number of items
double PD ; // Price of Item
double PrT; // Product Number for Thingamajigs
double NT; // Number of items
double PT; // Price of Item
double PrI; //Product Number for Invalid (> 3999)
double NI; // Number of items
double PI; // Price of Item
double total = 0;
int main ()
{
cout << "Enter the product number of the item sold: ";
cin >> ProdNumb;
while (ProdNumb != -1)
{
if (ProdNumb >= 0 && ProdNumb <= 999)
{
ProdNumb == PrG;
cout << "Enter the number of items sold: ";
cin >> NG;
cout << "Enter the price of one of the items sold: ";
cin >> PG;
}
cout << "Enter the product number of the item sold: ";
cin >> ProdNumb;
else (ProdNumb >= 1000 && ProdNumb <= 1999)
{
ProdNumb == PrW;
cout << "Enter the number of items sold: ";
cin >> NW;
cout << "Enter the price of one of the items sold: ";
cin >> PW;
cout << "Enter the product number of the item sold: ";
cin >> ProdNumb;
}
else (ProdNumb >= 2000 && ProdNumb <= 2999)
{
ProdNumb == PrD;
cout << "Enter the number of items sold: ";
cin >> ND;
cout << "Enter the price of one of the items sold: ";
cin >> PD;
cout << "Enter the product number of the item sold: ";
cin >> ProdNumb;
}
else (ProdNumb >= 3000 && ProdNumb <= 3999)
{
ProdNumb == PrT;
cout << "Enter the number of items sold: ";
cin >> NT;
cout << "Enter the price of one of the items sold: ";
cin >> PT;
cout << "Enter the product number of the item sold: ";
cin >> ProdNumb;
}
else (ProdNumb <= -2 && ProdNumb == 0 && ProdNumb >= 4000)
{
ProdNumb == PrI;
cout << "Enter the number of items sold: ";
cin >> NI;
cout << "Enter the price of one of the items sold: ";
cin >> PI;
cout << "Enter the product number of the item sold: ";
cin >> ProdNumb;
}
}
cout << "***** Product Sales Summary *****";
cout << "n";
cout << "n";
cout << "Gizmo Count: ";
total += NG;
cout << NG;
cout << "n";
cout << "Gizmo Sales Total: ";
cout << (NG)*(PG);
cout << "n";
cout << "n";
cout << "Widget Count: ";
total += NW;
cout << NW;
cout << "n";
cout << "Widget Sales Total: ";
cout << (NW)*(PW);
cout << "n";
cout << "n";
cout << "Dookickey Count: ";
total += ND;
cout << ND;
cout << "n";
cout << "Doohickey Sales Total: ";
cout << (ND)*(PD);
cout << "n";
cout << "n";
cout << "Thingamajig Count: ";
total += NT;
cout << NT;
cout << "n";
cout << "Thingamajig Sales Total: ";
cout << (NT)*(PT);
cout << "n";
cout << "n";
cout << "Invalid Sales: ";
total += NI;
cout << NI;
return 0;
}
Solution 1:
This code is not correct because after the if statement is closed with ‘}’ in this code, there are two statements before the else statement starts. There must not be any statements between the closing curly bracket ‘}’ of if statement and the else statement. It can be fixed by simply removing the part that I have marked in red.
Conclusion
And that’s it, I hope you were able to fix the expected primary-expression before error. This article wasn’t easy to write – I’m in no way an expert in C++, but I do know it to a decent level. I couldn’t find any articles related to fixing this error on the internet so I thought I’d write one myself. Answers that I read in forums helped me immensely while researching for this article and I’m thankful to the amazing community of programmers that we have built! If you would like to ask me anything, suggest any changes to this article or simply would like to write for us/collaborate with us, visit our Contact page. Thank you for reading, I hope you have an amazing day.
Also, tell me which one of the 6 types were you experiencing in the comments below.
I know this is a common question but the truth is every code is different. Sometimes it’s hard to apply the concept to your code, it does not work. So please help me. What is wrong with this code? I got it from GitHub. I’m trying to compile it first before I can do a little modification, it sends temp and humidity data to ThingSpeak cloud servers.
#include <DHT.h> // Including library for dht
#include <ESP8266WiFi.h>
String api_key = "YOUR API KEY"; // Enter your Write API key from ThingSpeak
const char *ssid = "YOUR WIFI SSID"; // replace with your wifi ssid and wpa2 key
const char *pass = "YOUR WIFI PASSWORD";
const char* server = "api.thingspeak.com";
#define DHTPIN 1 // pin where the dht11 is connected
DHT dht;
WiFiClient client;
void setup() {
Serial.begin(115200);
delay(10);
pinMode(2, OUTPUT);
digitalWrite(2, 0);
Serial.println("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
}
void loop() {
int chk = DHT.read(DHTPIN);
float hum = DHT.humidity;
float temp = DHT.temperature;
if (isnan(hum) || isnan(temp)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
if (client.connect(server, 80)) {
// "184.106.153.149" or api.thingspeak.com
String data_to_send = api_key;
data_to_send += "&field1=";
data_to_send += hum;
data_to_send += "&field2=";
data_to_send += temp;
data_to_send += "rnrn";
client.print("POST /update HTTP/1.1n");
client.print("Host: api.thingspeak.comn");
client.print("Connection: closen");
client.print("X-THINGSPEAKAPIKEY: " + api_key + "n");
client.print("Content-Type: application/x-www-form-
urlencodedn");
client.print("Content-Length: ");
client.print(data_to_send.length());
client.print("nn");
client.print(data_to_send);
delay(1000);
Serial.print("Temperature: ");
Serial.print(temp);
Serial.print(" degrees Celcius, Humidity: ");
Serial.print(hum);
Serial.println("%. Send to Thingspeak.");
}
client.stop();
Serial.println("Waiting...");
// ThingSpeak needs minimum 15 sec delay between updates, I've set it to 30 seconds
delay(10000);
}
When I compile I get this error,
Arduino: 1.8.10 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E
Module), 80 MHz, Flash,
Legacy (new can return nullptr), All SSL ciphers (most
compatible),
4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
C:UsersAgent 96Desktopthingspeakthingspeak.ino: In function 'void loop()':
thingspeak:37:20: error: expected primary-expression before '.' token
int chk = DHT.read(DHTPIN);
^
thingspeak:38:22: error: expected primary-expression before '.' token
float hum = DHT.humidity;
^
thingspeak:39:23: error: expected primary-expression before '.' token
float temp = DHT.temperature;
^
Multiple libraries were found for "DHT.h"
Used: C:UsersAgent
Not used: C:UsersAgent
Multiple libraries were found for "ESP8266WiFi.h"
Used: C:UsersAgent
exit status 1
expected primary-expression before '.' token
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Please help, I’m kind of a beginner.
I’m trying to update latest apex on the system with Cuda9.1, pytorch 1.1.0, ubuntu16.04.
and I got the error attached at the end.
Actually, I recently got a problem that my model performance degrades significantly after I updated my docker image from cuda9.1-pytorch1.1.0-old_apex to cuda9.2-pytorch1.4.0-latest_apex.
I want to check whether the issue came from updating pytorch or updating apex.
So hopefully there is any way to install on current system (Cuda9.1, pytorch 1.1.0, ubuntu16.04.) without changing the cuda and pytorch version.
/usr/local/lib/python3.5/dist-packages/pip/_internal/commands/install.py:244: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
cmdoptions.check_install_build_global(options)
Created temporary directory: /tmp/pip-ephem-wheel-cache-czknub85
Created temporary directory: /tmp/pip-req-tracker-4qfgsf2_
Created requirements tracker '/tmp/pip-req-tracker-4qfgsf2_'
Created temporary directory: /tmp/pip-install-n7l9uz2n
Processing /tmp/apex
Created temporary directory: /tmp/pip-req-build-u4sa6hp4
Added file:///tmp/apex to build tracker '/tmp/pip-req-tracker-4qfgsf2_'
Running setup.py (path:/tmp/pip-req-build-u4sa6hp4/setup.py) egg_info for package from file:///tmp/apex
Running command python setup.py egg_info
torch.__version__ = 1.1.0
running egg_info
creating pip-egg-info/apex.egg-info
writing pip-egg-info/apex.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/apex.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/apex.egg-info/top_level.txt
writing manifest file 'pip-egg-info/apex.egg-info/SOURCES.txt'
/tmp/pip-req-build-u4sa6hp4/setup.py:46: UserWarning: Option --pyprof not specified. Not installing PyProf dependencies!
warnings.warn("Option --pyprof not specified. Not installing PyProf dependencies!")
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info/apex.egg-info/SOURCES.txt'
writing manifest file 'pip-egg-info/apex.egg-info/SOURCES.txt'
Source in /tmp/pip-req-build-u4sa6hp4 has version 0.1, which satisfies requirement apex==0.1 from file:///tmp/apex
Removed apex==0.1 from file:///tmp/apex from build tracker '/tmp/pip-req-tracker-4qfgsf2_'
Skipping bdist_wheel for apex, due to binaries being disabled for it.
Installing collected packages: apex
Found existing installation: apex 0.1
Uninstalling apex-0.1:
Created temporary directory: /tmp/pip-uninstall-mp7b2fsu
Removing file or directory /usr/local/lib/python3.5/dist-packages/amp_C.cpython-35m-x86_64-linux-gnu.so
Created temporary directory: /usr/local/lib/python3.5/dist-packages/~pex-0.1.egg-info
Removing file or directory /usr/local/lib/python3.5/dist-packages/apex-0.1.egg-info
Created temporary directory: /usr/local/lib/python3.5/dist-packages/~pex
Removing file or directory /usr/local/lib/python3.5/dist-packages/apex/
Removing file or directory /usr/local/lib/python3.5/dist-packages/apex_C.cpython-35m-x86_64-linux-gnu.so
Removing file or directory /usr/local/lib/python3.5/dist-packages/fused_adam_cuda.cpython-35m-x86_64-linux-gnu.so
Removing file or directory /usr/local/lib/python3.5/dist-packages/fused_layer_norm_cuda.cpython-35m-x86_64-linux-gnu.so
Removing file or directory /usr/local/lib/python3.5/dist-packages/syncbn.cpython-35m-x86_64-linux-gnu.so
Successfully uninstalled apex-0.1
Created temporary directory: /tmp/pip-record-s2somaw8
Running command /usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-u4sa6hp4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-s2somaw8/install-record.txt --single-version-externally-managed --compile
torch.__version__ = 1.1.0
/tmp/pip-req-build-u4sa6hp4/setup.py:46: UserWarning: Option --pyprof not specified. Not installing PyProf dependencies!
warnings.warn("Option --pyprof not specified. Not installing PyProf dependencies!")
Compiling cuda extensions with
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85
from /usr/local/cuda/bin
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
creating build/lib.linux-x86_64-3.5/apex
copying apex/__init__.py -> build/lib.linux-x86_64-3.5/apex
creating build/lib.linux-x86_64-3.5/apex/RNN
copying apex/RNN/RNNBackend.py -> build/lib.linux-x86_64-3.5/apex/RNN
copying apex/RNN/__init__.py -> build/lib.linux-x86_64-3.5/apex/RNN
copying apex/RNN/cells.py -> build/lib.linux-x86_64-3.5/apex/RNN
copying apex/RNN/models.py -> build/lib.linux-x86_64-3.5/apex/RNN
creating build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/__init__.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/__version__.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/_amp_state.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/_initialize.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/_process_optimizer.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/amp.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/compat.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/frontend.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/handle.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/opt.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/rnn_compat.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/scaler.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/utils.py -> build/lib.linux-x86_64-3.5/apex/amp
copying apex/amp/wrap.py -> build/lib.linux-x86_64-3.5/apex/amp
creating build/lib.linux-x86_64-3.5/apex/fp16_utils
copying apex/fp16_utils/__init__.py -> build/lib.linux-x86_64-3.5/apex/fp16_utils
copying apex/fp16_utils/fp16_optimizer.py -> build/lib.linux-x86_64-3.5/apex/fp16_utils
copying apex/fp16_utils/fp16util.py -> build/lib.linux-x86_64-3.5/apex/fp16_utils
copying apex/fp16_utils/loss_scaler.py -> build/lib.linux-x86_64-3.5/apex/fp16_utils
creating build/lib.linux-x86_64-3.5/apex/multi_tensor_apply
copying apex/multi_tensor_apply/__init__.py -> build/lib.linux-x86_64-3.5/apex/multi_tensor_apply
copying apex/multi_tensor_apply/multi_tensor_apply.py -> build/lib.linux-x86_64-3.5/apex/multi_tensor_apply
creating build/lib.linux-x86_64-3.5/apex/normalization
copying apex/normalization/__init__.py -> build/lib.linux-x86_64-3.5/apex/normalization
copying apex/normalization/fused_layer_norm.py -> build/lib.linux-x86_64-3.5/apex/normalization
creating build/lib.linux-x86_64-3.5/apex/optimizers
copying apex/optimizers/__init__.py -> build/lib.linux-x86_64-3.5/apex/optimizers
copying apex/optimizers/fused_adam.py -> build/lib.linux-x86_64-3.5/apex/optimizers
copying apex/optimizers/fused_lamb.py -> build/lib.linux-x86_64-3.5/apex/optimizers
copying apex/optimizers/fused_novograd.py -> build/lib.linux-x86_64-3.5/apex/optimizers
copying apex/optimizers/fused_sgd.py -> build/lib.linux-x86_64-3.5/apex/optimizers
creating build/lib.linux-x86_64-3.5/apex/parallel
copying apex/parallel/LARC.py -> build/lib.linux-x86_64-3.5/apex/parallel
copying apex/parallel/__init__.py -> build/lib.linux-x86_64-3.5/apex/parallel
copying apex/parallel/distributed.py -> build/lib.linux-x86_64-3.5/apex/parallel
copying apex/parallel/multiproc.py -> build/lib.linux-x86_64-3.5/apex/parallel
copying apex/parallel/optimized_sync_batchnorm.py -> build/lib.linux-x86_64-3.5/apex/parallel
copying apex/parallel/optimized_sync_batchnorm_kernel.py -> build/lib.linux-x86_64-3.5/apex/parallel
copying apex/parallel/sync_batchnorm.py -> build/lib.linux-x86_64-3.5/apex/parallel
copying apex/parallel/sync_batchnorm_kernel.py -> build/lib.linux-x86_64-3.5/apex/parallel
creating build/lib.linux-x86_64-3.5/apex/reparameterization
copying apex/reparameterization/__init__.py -> build/lib.linux-x86_64-3.5/apex/reparameterization
copying apex/reparameterization/reparameterization.py -> build/lib.linux-x86_64-3.5/apex/reparameterization
copying apex/reparameterization/weight_norm.py -> build/lib.linux-x86_64-3.5/apex/reparameterization
creating build/lib.linux-x86_64-3.5/apex/contrib
copying apex/contrib/__init__.py -> build/lib.linux-x86_64-3.5/apex/contrib
creating build/lib.linux-x86_64-3.5/apex/mlp
copying apex/mlp/__init__.py -> build/lib.linux-x86_64-3.5/apex/mlp
copying apex/mlp/mlp.py -> build/lib.linux-x86_64-3.5/apex/mlp
creating build/lib.linux-x86_64-3.5/apex/pyprof
copying apex/pyprof/__init__.py -> build/lib.linux-x86_64-3.5/apex/pyprof
creating build/lib.linux-x86_64-3.5/apex/amp/lists
copying apex/amp/lists/__init__.py -> build/lib.linux-x86_64-3.5/apex/amp/lists
copying apex/amp/lists/functional_overrides.py -> build/lib.linux-x86_64-3.5/apex/amp/lists
copying apex/amp/lists/tensor_overrides.py -> build/lib.linux-x86_64-3.5/apex/amp/lists
copying apex/amp/lists/torch_overrides.py -> build/lib.linux-x86_64-3.5/apex/amp/lists
creating build/lib.linux-x86_64-3.5/apex/contrib/groupbn
copying apex/contrib/groupbn/__init__.py -> build/lib.linux-x86_64-3.5/apex/contrib/groupbn
copying apex/contrib/groupbn/batch_norm.py -> build/lib.linux-x86_64-3.5/apex/contrib/groupbn
creating build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
copying apex/contrib/multihead_attn/__init__.py -> build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
copying apex/contrib/multihead_attn/encdec_multihead_attn.py -> build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
copying apex/contrib/multihead_attn/encdec_multihead_attn_func.py -> build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
copying apex/contrib/multihead_attn/fast_encdec_multihead_attn_func.py -> build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
copying apex/contrib/multihead_attn/fast_encdec_multihead_attn_norm_add_func.py -> build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
copying apex/contrib/multihead_attn/fast_self_multihead_attn_func.py -> build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
copying apex/contrib/multihead_attn/fast_self_multihead_attn_norm_add_func.py -> build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
copying apex/contrib/multihead_attn/self_multihead_attn.py -> build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
copying apex/contrib/multihead_attn/self_multihead_attn_func.py -> build/lib.linux-x86_64-3.5/apex/contrib/multihead_attn
creating build/lib.linux-x86_64-3.5/apex/contrib/optimizers
copying apex/contrib/optimizers/__init__.py -> build/lib.linux-x86_64-3.5/apex/contrib/optimizers
copying apex/contrib/optimizers/fp16_optimizer.py -> build/lib.linux-x86_64-3.5/apex/contrib/optimizers
copying apex/contrib/optimizers/fused_adam.py -> build/lib.linux-x86_64-3.5/apex/contrib/optimizers
copying apex/contrib/optimizers/fused_lamb.py -> build/lib.linux-x86_64-3.5/apex/contrib/optimizers
copying apex/contrib/optimizers/fused_sgd.py -> build/lib.linux-x86_64-3.5/apex/contrib/optimizers
creating build/lib.linux-x86_64-3.5/apex/contrib/xentropy
copying apex/contrib/xentropy/__init__.py -> build/lib.linux-x86_64-3.5/apex/contrib/xentropy
copying apex/contrib/xentropy/softmax_xentropy.py -> build/lib.linux-x86_64-3.5/apex/contrib/xentropy
creating build/lib.linux-x86_64-3.5/apex/pyprof/nvtx
copying apex/pyprof/nvtx/__init__.py -> build/lib.linux-x86_64-3.5/apex/pyprof/nvtx
copying apex/pyprof/nvtx/nvmarker.py -> build/lib.linux-x86_64-3.5/apex/pyprof/nvtx
creating build/lib.linux-x86_64-3.5/apex/pyprof/parse
copying apex/pyprof/parse/__init__.py -> build/lib.linux-x86_64-3.5/apex/pyprof/parse
copying apex/pyprof/parse/__main__.py -> build/lib.linux-x86_64-3.5/apex/pyprof/parse
copying apex/pyprof/parse/db.py -> build/lib.linux-x86_64-3.5/apex/pyprof/parse
copying apex/pyprof/parse/kernel.py -> build/lib.linux-x86_64-3.5/apex/pyprof/parse
copying apex/pyprof/parse/nvvp.py -> build/lib.linux-x86_64-3.5/apex/pyprof/parse
copying apex/pyprof/parse/parse.py -> build/lib.linux-x86_64-3.5/apex/pyprof/parse
creating build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/__init__.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/__main__.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/activation.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/base.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/blas.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/conv.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/convert.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/data.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/dropout.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/embedding.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/index_slice_join_mutate.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/linear.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/loss.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/misc.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/normalization.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/optim.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/output.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/pointwise.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/pooling.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/prof.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/randomSample.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/recurrentCell.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/reduction.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/softmax.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/usage.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
copying apex/pyprof/prof/utility.py -> build/lib.linux-x86_64-3.5/apex/pyprof/prof
running build_ext
building 'apex_C' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/csrc
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/include/python3.5m -c csrc/flatten_unflatten.cpp -o build/temp.linux-x86_64-3.5/csrc/flatten_unflatten.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=apex_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/csrc/flatten_unflatten.o -o build/lib.linux-x86_64-3.5/apex_C.cpython-35m-x86_64-linux-gnu.so
building 'amp_C' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/amp_C_frontend.cpp -o build/temp.linux-x86_64-3.5/csrc/amp_C_frontend.o -O3 -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/multi_tensor_sgd_kernel.cu -o build/temp.linux-x86_64-3.5/csrc/multi_tensor_sgd_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/multi_tensor_scale_kernel.cu -o build/temp.linux-x86_64-3.5/csrc/multi_tensor_scale_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/multi_tensor_axpby_kernel.cu -o build/temp.linux-x86_64-3.5/csrc/multi_tensor_axpby_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/multi_tensor_l2norm_kernel.cu -o build/temp.linux-x86_64-3.5/csrc/multi_tensor_l2norm_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/multi_tensor_lamb_stage_1.cu -o build/temp.linux-x86_64-3.5/csrc/multi_tensor_lamb_stage_1.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/multi_tensor_lamb_stage_2.cu -o build/temp.linux-x86_64-3.5/csrc/multi_tensor_lamb_stage_2.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/multi_tensor_adam.cu -o build/temp.linux-x86_64-3.5/csrc/multi_tensor_adam.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/multi_tensor_novograd.cu -o build/temp.linux-x86_64-3.5/csrc/multi_tensor_novograd.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/multi_tensor_lamb.cu -o build/temp.linux-x86_64-3.5/csrc/multi_tensor_lamb.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -lineinfo -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=amp_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/csrc/amp_C_frontend.o build/temp.linux-x86_64-3.5/csrc/multi_tensor_sgd_kernel.o build/temp.linux-x86_64-3.5/csrc/multi_tensor_scale_kernel.o build/temp.linux-x86_64-3.5/csrc/multi_tensor_axpby_kernel.o build/temp.linux-x86_64-3.5/csrc/multi_tensor_l2norm_kernel.o build/temp.linux-x86_64-3.5/csrc/multi_tensor_lamb_stage_1.o build/temp.linux-x86_64-3.5/csrc/multi_tensor_lamb_stage_2.o build/temp.linux-x86_64-3.5/csrc/multi_tensor_adam.o build/temp.linux-x86_64-3.5/csrc/multi_tensor_novograd.o build/temp.linux-x86_64-3.5/csrc/multi_tensor_lamb.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.5/amp_C.cpython-35m-x86_64-linux-gnu.so
building 'syncbn' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/syncbn.cpp -o build/temp.linux-x86_64-3.5/csrc/syncbn.o -O3 -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=syncbn -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/welford.cu -o build/temp.linux-x86_64-3.5/csrc/welford.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -O3 -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=syncbn -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/csrc/syncbn.o build/temp.linux-x86_64-3.5/csrc/welford.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.5/syncbn.cpython-35m-x86_64-linux-gnu.so
building 'fused_layer_norm_cuda' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/layer_norm_cuda.cpp -o build/temp.linux-x86_64-3.5/csrc/layer_norm_cuda.o -O3 -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=fused_layer_norm_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
/usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/layer_norm_cuda_kernel.cu -o build/temp.linux-x86_64-3.5/csrc/layer_norm_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -maxrregcount=50 -O3 --use_fast_math -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=fused_layer_norm_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
csrc/layer_norm_cuda_kernel.cu(271): warning: function "<unnamed>::SharedMemory<double>::getPointer" was declared but never referenced
csrc/layer_norm_cuda_kernel.cu(261): warning: function "<unnamed>::SharedMemory<float>::getPointer" was declared but never referenced
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/csrc/layer_norm_cuda.o build/temp.linux-x86_64-3.5/csrc/layer_norm_cuda_kernel.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.5/fused_layer_norm_cuda.cpython-35m-x86_64-linux-gnu.so
building 'mlp_cuda' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.5/dist-packages/torch/include -I/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.5/dist-packages/torch/include/TH -I/usr/local/lib/python3.5/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.5m -c csrc/mlp.cpp -o build/temp.linux-x86_64-3.5/csrc/mlp.o -O3 -DVERSION_GE_1_1 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=mlp_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from csrc/mlp.cpp:2:0:
/usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/torch.h:7:2: warning: #warning "Including torch/torch.h for C++ extensions is deprecated. Please include torch/extension.h" [-Wcpp]
#warning
^
csrc/mlp.cpp: In function 'std::vector<at::Tensor> mlp_forward(std::vector<at::Tensor>)':
csrc/mlp.cpp:47:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < num_layers; i++) {
^
csrc/mlp.cpp:56:68: warning: narrowing conversion of 'reserved_size' from 'long unsigned int' to 'long int' inside { } [-Wnarrowing]
auto reserved_space = at::empty({reserved_size}, inputs[0].type());
^
csrc/mlp.cpp:56:68: warning: narrowing conversion of 'reserved_size' from 'long unsigned int' to 'long int' inside { } [-Wnarrowing]
In file included from /usr/local/lib/python3.5/dist-packages/torch/include/ATen/ATen.h:9:0,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/extension.h:4,
from csrc/mlp.cpp:1:
csrc/mlp.cpp: In lambda function:
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:84:52: warning: 'c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)' is deprecated [-Wdeprecated-declarations]
at::ScalarType _st = ::detail::scalar_type(TYPE);
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:47:23: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties &t) {
^
In file included from /usr/local/lib/python3.5/dist-packages/torch/include/ATen/ATen.h:9:0,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/extension.h:4,
from csrc/mlp.cpp:1:
csrc/mlp.cpp: In lambda function:
csrc/mlp.cpp:61:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < num_layers; i++) {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:62:54: error: expected primary-expression before '>' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:62:56: error: expected primary-expression before ')' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:63:67: error: expected primary-expression before '>' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:63:69: error: expected primary-expression before ')' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:66:36: error: expected primary-expression before '>' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:66:38: error: expected primary-expression before ')' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:73:30: error: expected primary-expression before '>' token
out.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:73:32: error: expected primary-expression before ')' token
out.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:74:41: error: expected primary-expression before '>' token
reserved_space.data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:74:43: error: expected primary-expression before ')' token
reserved_space.data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp: In lambda function:
csrc/mlp.cpp:61:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < num_layers; i++) {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:62:54: error: expected primary-expression before '>' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:62:56: error: expected primary-expression before ')' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:63:67: error: expected primary-expression before '>' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:63:69: error: expected primary-expression before ')' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:66:36: error: expected primary-expression before '>' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:66:38: error: expected primary-expression before ')' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:73:30: error: expected primary-expression before '>' token
out.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:73:32: error: expected primary-expression before ')' token
out.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:74:41: error: expected primary-expression before '>' token
reserved_space.data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:74:43: error: expected primary-expression before ')' token
reserved_space.data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp: In lambda function:
csrc/mlp.cpp:61:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < num_layers; i++) {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:62:54: error: expected primary-expression before '>' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:62:56: error: expected primary-expression before ')' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:63:67: error: expected primary-expression before '>' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:63:69: error: expected primary-expression before ')' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:66:36: error: expected primary-expression before '>' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:66:38: error: expected primary-expression before ')' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:73:30: error: expected primary-expression before '>' token
out.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:73:32: error: expected primary-expression before ')' token
out.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:74:41: error: expected primary-expression before '>' token
reserved_space.data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:74:43: error: expected primary-expression before ')' token
reserved_space.data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:58:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp: In function 'std::vector<at::Tensor> mlp_backward(at::Tensor, std::vector<at::Tensor>, std::vector<at::Tensor>)':
csrc/mlp.cpp:90:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < num_layers; i++) {
^
csrc/mlp.cpp:95:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < inputs.size(); i++) {
^
In file included from /usr/local/lib/python3.5/dist-packages/torch/include/ATen/ATen.h:9:0,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/extension.h:4,
from csrc/mlp.cpp:1:
csrc/mlp.cpp: In lambda function:
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:84:52: warning: 'c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)' is deprecated [-Wdeprecated-declarations]
at::ScalarType _st = ::detail::scalar_type(TYPE);
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:47:23: note: declared here
inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties &t) {
^
In file included from /usr/local/lib/python3.5/dist-packages/torch/include/ATen/ATen.h:9:0,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/csrc/api/include/torch/all.h:4,
from /usr/local/lib/python3.5/dist-packages/torch/include/torch/extension.h:4,
from csrc/mlp.cpp:1:
csrc/mlp.cpp: In lambda function:
csrc/mlp.cpp:102:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < num_layers; i++) {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:103:54: error: expected primary-expression before '>' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:103:56: error: expected primary-expression before ')' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:104:67: error: expected primary-expression before '>' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:104:69: error: expected primary-expression before ')' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:107:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < inputs.size(); i++) {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:108:57: error: expected primary-expression before '>' token
outputs_ptr.push_back(outputs[i].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:108:59: error: expected primary-expression before ')' token
outputs_ptr.push_back(outputs[i].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:115:44: warning: narrowing conversion of '(work_size / sizeof (scalar_t))' from 'long unsigned int' to 'long int' inside { } [-Wnarrowing]
auto work_space = at::empty({work_size / sizeof(scalar_t)}, inputs[0].type());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:115:44: warning: narrowing conversion of '(work_size / sizeof (scalar_t))' from 'long unsigned int' to 'long int' inside { } [-Wnarrowing]
auto work_space = at::empty({work_size / sizeof(scalar_t)}, inputs[0].type());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:118:36: error: expected primary-expression before '>' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:118:38: error: expected primary-expression before ')' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:119:43: error: expected primary-expression before '>' token
fprop_outputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:119:45: error: expected primary-expression before ')' token
fprop_outputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:125:46: error: expected primary-expression before '>' token
grad_o.contiguous().data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:125:48: error: expected primary-expression before ')' token
grad_o.contiguous().data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:126:43: error: expected primary-expression before '>' token
fprop_outputs[1].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:126:45: error: expected primary-expression before ')' token
fprop_outputs[1].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:127:37: error: expected primary-expression before '>' token
work_space.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:127:39: error: expected primary-expression before ')' token
work_space.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp: In lambda function:
csrc/mlp.cpp:102:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < num_layers; i++) {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:103:54: error: expected primary-expression before '>' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:103:56: error: expected primary-expression before ')' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:104:67: error: expected primary-expression before '>' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:104:69: error: expected primary-expression before ')' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:107:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < inputs.size(); i++) {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:108:57: error: expected primary-expression before '>' token
outputs_ptr.push_back(outputs[i].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:108:59: error: expected primary-expression before ')' token
outputs_ptr.push_back(outputs[i].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:115:44: warning: narrowing conversion of '(work_size / sizeof (scalar_t))' from 'long unsigned int' to 'long int' inside { } [-Wnarrowing]
auto work_space = at::empty({work_size / sizeof(scalar_t)}, inputs[0].type());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:115:44: warning: narrowing conversion of '(work_size / sizeof (scalar_t))' from 'long unsigned int' to 'long int' inside { } [-Wnarrowing]
auto work_space = at::empty({work_size / sizeof(scalar_t)}, inputs[0].type());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:118:36: error: expected primary-expression before '>' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:118:38: error: expected primary-expression before ')' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:119:43: error: expected primary-expression before '>' token
fprop_outputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:119:45: error: expected primary-expression before ')' token
fprop_outputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:125:46: error: expected primary-expression before '>' token
grad_o.contiguous().data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:125:48: error: expected primary-expression before ')' token
grad_o.contiguous().data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:126:43: error: expected primary-expression before '>' token
fprop_outputs[1].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:126:45: error: expected primary-expression before ')' token
fprop_outputs[1].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:127:37: error: expected primary-expression before '>' token
work_space.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:127:39: error: expected primary-expression before ')' token
work_space.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp: In lambda function:
csrc/mlp.cpp:102:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < num_layers; i++) {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:103:54: error: expected primary-expression before '>' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:103:56: error: expected primary-expression before ')' token
w_ptr.push_back(inputs[i + 1].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:104:67: error: expected primary-expression before '>' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:104:69: error: expected primary-expression before ')' token
b_ptr.push_back(inputs[i + 1 + num_layers].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:107:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < inputs.size(); i++) {
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:108:57: error: expected primary-expression before '>' token
outputs_ptr.push_back(outputs[i].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:108:59: error: expected primary-expression before ')' token
outputs_ptr.push_back(outputs[i].data_ptr<scalar_t>());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:115:44: warning: narrowing conversion of '(work_size / sizeof (scalar_t))' from 'long unsigned int' to 'long int' inside { } [-Wnarrowing]
auto work_space = at::empty({work_size / sizeof(scalar_t)}, inputs[0].type());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:115:44: warning: narrowing conversion of '(work_size / sizeof (scalar_t))' from 'long unsigned int' to 'long int' inside { } [-Wnarrowing]
auto work_space = at::empty({work_size / sizeof(scalar_t)}, inputs[0].type());
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:118:36: error: expected primary-expression before '>' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:118:38: error: expected primary-expression before ')' token
inputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:119:43: error: expected primary-expression before '>' token
fprop_outputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:119:45: error: expected primary-expression before ')' token
fprop_outputs[0].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:125:46: error: expected primary-expression before '>' token
grad_o.contiguous().data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:125:48: error: expected primary-expression before ')' token
grad_o.contiguous().data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:126:43: error: expected primary-expression before '>' token
fprop_outputs[1].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:126:45: error: expected primary-expression before ')' token
fprop_outputs[1].data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:127:37: error: expected primary-expression before '>' token
work_space.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
csrc/mlp.cpp:127:39: error: expected primary-expression before ')' token
work_space.data_ptr<scalar_t>(),
^
/usr/local/lib/python3.5/dist-packages/torch/include/ATen/Dispatch.h:11:12: note: in definition of macro 'AT_PRIVATE_CASE_TYPE'
return __VA_ARGS__();
^
csrc/mlp.cpp:99:3: note: in expansion of macro 'AT_DISPATCH_FLOATING_TYPES_AND_HALF'
AT_DISPATCH_FLOATING_TYPES_AND_HALF(inputs[0].type(), "mlp_forward", [&] {
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Running setup.py install for apex ... error
Rolling back uninstall of apex
Moving to /usr/local/lib/python3.5/dist-packages/amp_C.cpython-35m-x86_64-linux-gnu.so
from /tmp/pip-uninstall-mp7b2fsu/amp_C.cpython-35m-x86_64-linux-gnu.so
Moving to /usr/local/lib/python3.5/dist-packages/apex-0.1.egg-info
from /usr/local/lib/python3.5/dist-packages/~pex-0.1.egg-info
Moving to /usr/local/lib/python3.5/dist-packages/apex/
from /usr/local/lib/python3.5/dist-packages/~pex
Moving to /usr/local/lib/python3.5/dist-packages/apex_C.cpython-35m-x86_64-linux-gnu.so
from /tmp/pip-uninstall-mp7b2fsu/apex_C.cpython-35m-x86_64-linux-gnu.so
Moving to /usr/local/lib/python3.5/dist-packages/fused_adam_cuda.cpython-35m-x86_64-linux-gnu.so
from /tmp/pip-uninstall-mp7b2fsu/fused_adam_cuda.cpython-35m-x86_64-linux-gnu.so
Moving to /usr/local/lib/python3.5/dist-packages/fused_layer_norm_cuda.cpython-35m-x86_64-linux-gnu.so
from /tmp/pip-uninstall-mp7b2fsu/fused_layer_norm_cuda.cpython-35m-x86_64-linux-gnu.so
Moving to /usr/local/lib/python3.5/dist-packages/syncbn.cpython-35m-x86_64-linux-gnu.so
from /tmp/pip-uninstall-mp7b2fsu/syncbn.cpython-35m-x86_64-linux-gnu.so
Replacing /usr/local/lib/python3.5/dist-packages/amp_C.cpython-35m-x86_64-linux-gnu.so from /tmp/pip-uninstall-mp7b2fsu/amp_C.cpython-35m-x86_64-linux-gnu.so
Replacing /usr/local/lib/python3.5/dist-packages/apex-0.1.egg-info from /usr/local/lib/python3.5/dist-packages/~pex-0.1.egg-info
Replacing /usr/local/lib/python3.5/dist-packages/apex/ from /usr/local/lib/python3.5/dist-packages/~pex
Replacing /usr/local/lib/python3.5/dist-packages/apex_C.cpython-35m-x86_64-linux-gnu.so from /tmp/pip-uninstall-mp7b2fsu/apex_C.cpython-35m-x86_64-linux-gnu.so
Replacing /usr/local/lib/python3.5/dist-packages/fused_adam_cuda.cpython-35m-x86_64-linux-gnu.so from /tmp/pip-uninstall-mp7b2fsu/fused_adam_cuda.cpython-35m-x86_64-linux-gnu.so
Replacing /usr/local/lib/python3.5/dist-packages/fused_layer_norm_cuda.cpython-35m-x86_64-linux-gnu.so from /tmp/pip-uninstall-mp7b2fsu/fused_layer_norm_cuda.cpython-35m-x86_64-linux-gnu.so
Replacing /usr/local/lib/python3.5/dist-packages/syncbn.cpython-35m-x86_64-linux-gnu.so from /tmp/pip-uninstall-mp7b2fsu/syncbn.cpython-35m-x86_64-linux-gnu.so
Cleaning up...
Removing source in /tmp/pip-req-build-u4sa6hp4
Removed build tracker '/tmp/pip-req-tracker-4qfgsf2_'
ERROR: Command "/usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-u4sa6hp4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-s2somaw8/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-u4sa6hp4/
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/base_command.py", line 178, in main
status = self.run(options, args)
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/commands/install.py", line 414, in run
use_user_site=options.use_user_site,
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/req/__init__.py", line 58, in install_given_reqs
**kwargs
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/req/req_install.py", line 951, in install
spinner=spinner,
File "/usr/local/lib/python3.5/dist-packages/pip/_internal/utils/misc.py", line 776, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip._internal.exceptions.InstallationError: Command "/usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-req-build-u4sa6hp4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' --cpp_ext --cuda_ext install --record /tmp/pip-record-s2somaw8/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-req-build-u4sa6hp4/
