Compilation error expected primary expression before token

This code compiles and works as expected (it throws at runtime, but never mind): #include #include void foo(boost::property_tree::ptree &amp...

This code compiles and works as expected (it throws at runtime, but never mind):

#include <iostream>
#include <boost/property_tree/ptree.hpp>

void foo(boost::property_tree::ptree &pt) 
{
    std::cout << pt.get<std::string>("path"); // <---
}

int main()
{
    boost::property_tree::ptree pt;
    foo(pt);
    return 0;
}

But as soon as I add templates and change the foo prototype into

template<class ptree>
void foo(ptree &pt)

I get an error in GCC:

test_ptree.cpp: In function ‘void foo(ptree&)’:
test_ptree.cpp:7: error: expected primary-expression before ‘>’ token

but no errors with MSVC++! The error is in the marked line <---. And again, if I change the problem line into

--- std::cout << pt.get<std::string>("path"); // <---
+++ std::cout << pt.get("path", "default value");

the error disappears (the problem is in explicit <std::string>).

Boost.PropertyTree requires Boost >= 1.41. Please help me to understand and fix this error.


See Templates: template function not playing well with class’s template member function — a similar popular question containing other good answers and explanations.

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; 
}



<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>


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.

In a legacy C++ project that is using Boost ProgramOptions. trying to compile it will yield this error message:

In file included from /usr/include/boost/lexical_cast/detail/converter_lexical.hpp:50:0,
                 from /usr/include/boost/lexical_cast/try_lexical_convert.hpp:42,
                 from /usr/include/boost/lexical_cast.hpp:32,
                 from /usr/include/boost/program_options/value_semantic.hpp:14,
                 from /usr/include/boost/program_options/options_description.hpp:13,
                 from /usr/include/boost/program_options.hpp:15,
                 from /home/uli/dev/myproject/datasplit.cpp:15:
/usr/include/boost/array.hpp: In member function ‘T& boost::array<T, N>::operator[](boost::array<T, N>::size_type)’:
/usr/include/boost/array.hpp:118:61: error: expected primary-expression before ‘,’ token
             return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];

I didn’t find a satisfying way to fix this issue but it can be worked around fixing the issue in the source file:

First, open /usr/include/boost/array.hpp in your favourite editor as root (sudo!). I use nano.

Then, go to line 118 which reads:

return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];

Replace that line by

BOOST_ASSERT_MSG( i < N, "out of range" );
return elems[i];

Also, 4 lines below what we just edited you’ll find another instance of

return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i];

Also replace that by

BOOST_ASSERT_MSG( i < N, "out of range" );
return elems[i];

Now. save the file and close your editor. Your code should compile now.

How to fix expected primary expression beforeThe expected primary expression before occurs due to syntax errors. It usually has a character or a keyword at the end that clarifies the cause. Here you’ll get access to the most common syntax mistakes that throw the same error.

Continue reading to see where you might be getting wrong and how you can solve the issue.

Contents

  • Why Does the Expected Primary Expression Before Occur?
    • – You Are Specifying the Data Type With Function Argument
    • – The Wrong Type of Arguments
    • – Issue With the Curly Braces Resulting in Expected Primary Expression Before }
    • – The Parenthesis Following the If Statement Don’t Contain an Expression
  • How To Fix the Given Error?
    • – Remove the Data Type That Precedes the Function Argument
    • – Pass the Arguments of the Expected Data Type
    • – Ensure The Equal Number of Opening and Closing Curly Brackets
    • – Add an Expression in the If Statement Parenthesis
  • FAQ
    • – What Does It Mean When the Error Says “Expected Primary Expression Before Int” in C?
    • – What Is a Primary Expression in C Language?
    • – What Are the Types of Expressions?
  • Conclusion

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

What is expected primary expression before errorThe more you learn the syntax and practice coding, the more easily you’ll be able to solve the error.

  • Author
  • Recent Posts

Position is Everything

Position Is Everything: Your Go-To Resource for Learn & Build: CSS,JavaScript,HTML,PHP,C++ and MYSQL.

Position is Everything

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
#include <iostream>
using namespace std ;

int main (int argc, char * const argv [] ) {
	// Method declarations
	void pseudoMain () ;
	
	copyright () ;
	pseudoMain () ;
	
	// Return before end of script
	cout << endl << endl ;
	return 0 ;
	}

void pseudoMain () {
	// Variable declarations
	char compFirstChar ;
	bool compFirst ;
	bool gameOver ;
	int poisonNum ;
	int max ;
	int lastNum ;
	int midlNum ;
	int enteredNum = 1 ;
	
	// Method declarations
	void restart () ;
	void error (int errorCode) ;
	int determineStepStones (int stepStones [] , int poisonNum, int max) ;
	int display (int lastNum, int enteredNum) ;
//f	void play (int enteredNum) ;
	int compTurn (int poisonNum, int max, int lastNum, int midlNum, int enteredNum, int stepStones [] ) ;
	int userTurn (int poisonNum, int max, int lastNum, int midlNum, int enteredNum, int stepStones [] ) ;
	
	// Set the variables
	cout << "Would you like the computer to go first (y|n) ?	" ;
	cin >> compFirstChar ;
	switch (compFirstChar) {
		case 'y' :
			compFirst = true ;
			break ;
			
		case 'n' :
			compFirst = false ;
			break ;

		default:
			error (1) ;
			break ;
		}
	cout << "Please enter a positive number to be the “poison” number:	" ;
	cin >> poisonNum ;
	cout << "Please enter a positive number to be the maximum number of numbers that a player may go through at any one time:	" ;
	cin >> max ;
	int* stepStones [poisonNum / max] ;
	determineStepStones (stepStones [poisonNum / max] , poisonNum, max) ;
	
	// Start the game
	system ( "clear" ) ;
	
	if (compFirst == true) { lastNum = compTurn (poisonNum, max, lastNum, enteredNum, stepStones* [poisonNum / max] ) ; }
	while (gameOver == false) {
		if (gameOver == false) { lastNum = userTurn (poisonNum, max, lastNum, enteredNum, stepStones* [poisonNum / max] ) ; }
		else { break ; }
		if (gameOver == false) { lastNum = compTurn (poisonNum, max, lastNum, enteredNum, stepStones* [poisonNum / max] ) ; }
		else { break ; }
		}
	}

void restart () {
	cout << endl << "Restarting script…" << endl ;
	system ( "clear" ) ;
	copyright () ;
	pseudoMain () ;
	}

void error (int errorCode) {
	switch (errorCode) {
		case 0:
			cout << "Error 0 (983-853) : an unknown error has occured." ;
			restart () ;
			break ;
			
		case 1:
			cout << "Error 1 (96-483.23) : you did not enter a lowercase 'y' (for yes) or a lowercase 'n' (for no) when I asked you if you wanted the computer to go first.  Remember, computers are picky, so you must be pseudoperfect!"  << endl ;
			restart () ;
			break ;

		case 2:
			cout << "Error 2 (46-3662) : the number you have entered is not acceptable.  You must enter a number between the two numbers given." ;
			break ;
			
		default:
			error (0) ;
			break ;
		}
	}

int determineStepStones (int stepStones [] , int poisonNum, int max) {
	// This is backwards, but the resulting array makes more sense.
	// Sets the last “stepping stone” number to what it is (the “poison” number minus one)
	stepStones [poisonNum / max] = poisonNum - 1 ;
	// Sets all of the rest of the “stepping stone” numbers to what they are (the previous “stepping stone” number minus max)
	for (int i = poisonNum / max ; i >= 0 ; i -- ) { stepStones [i] = stepStones [i - 1] - (max + 1) ; }
	}

int display (int lastNum, int enteredNum) {
	cout << endl ;
	for (int i = lastNum ; i <= enteredNum ; i ++ ) {
		cout << i << ", " ;
		}
	cout << enteredNum << endl ;
	}

int compTurn (int poisonNum, int max, int lastNum, int midlNum, int enteredNum, int* stepStones [] ) {
	enteredNum = midlNum ;
	
	for (int i = enteredNum ; i < enteredNum + max ; i ++ ) {
		for (int j = 0 ; j < poisonNum / max ; j ++ ) {
			if (i == stepStones [j] ) {
				display (lastNum, enteredNum) ;
				break ;
				}
			}
		}
	
	midlNum = lastNum ;
	return lastNum ;
	}

int userTurn (int poisonNum, int max, int lastNum, int midlNum, int enteredNum, int* stepStones [] ) {
	enteredNum = midlNum ;
	
	cout << "Enter a number above " << lastNum << " and below " << lastNum + max + 1 << " (exclusive) :	" ;
	cin >> enteredNum ;
	if (lastNum < enteredNum <= lastNum + max) { display (lastNum, enteredNum) ; }
	else {
		error (2) ;
		midlNum = enteredNum ;
		lastNum = userTurn (poisonNum, max, lastNum, midlNum, enteredNum, stepStones* [poisonNum / max] ) ;
		return lastNum ;
		}

	midlNum = lastNum ;
	return lastNum ;
	}

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/

Понравилась статья? Поделить с друзьями:
  • Compilation error esp8266wifi h no such file or directory
  • Compilation error cannot find symbol
  • Compilation error acmp
  • Compilation error a function definition is not allowed here before token
  • Compatmode как исправить приложение