text
stringlengths
13
30k
{"id": "9642c003ef", "text": " what interview! leave me alone", "label": 0, "label_text": "negative"}
{"id": "358bd9e861", "text": " Sons of ****, why couldn`t they put them on the releases we already bought", "label": 0, "label_text": "negative"}
{"id": "28b57f3990", "text": "http://www.dothebouncy.com/smf - some shameless plugging for the best Rangers forum on earth", "label": 1, "label_text": "neutral"}
{"id": "6e0c6d75b1", "text": "2am feedings for the baby are fun when he is all smiles and coos", "label": 2, "label_text": "positive"}
{"id": "e050245fbd", "text": " Both of you", "label": 1, "label_text": "neutral"}
{"id": "fc2cbefa9d", "text": " Journey!? Wow... u just became cooler. hehe... (is that possible!?)", "label": 2, "label_text": "positive"}
{"MedlineCitation": {"PMID": 30970, "DateCompleted": {"Year": 1979, "Month": 1, "Day": 24}, "NumberOfReferences": 0, "DateRevised": {"Year": 2013, "Month": 11, "Day": 21}, "Article": {"Abstract": {"AbstractText": ""}, "ArticleTitle": "[Beta-blockers and arterial hypertension in the pregnant woman].", "AuthorList": {"Author": {"LastName": ["Tcherdakoff"], "ForeName": ["P"], "Initials": ["P"], "CollectiveName": [""]}}, "Language": "fre", "GrantList": {"Grant": {"GrantID": [], "Agency": [], "Country": []}}, "PublicationTypeList": {"PublicationType": ["Journal Article"]}}, "MedlineJournalInfo": {"Country": "France"}, "ChemicalList": {"Chemical": {"RegistryNumber": ["0", "9Y8NXQ24VQ"], "NameOfSubstance": ["Adrenergic beta-Antagonists", "Propranolol"]}}, "CitationSubset": "IM", "MeshHeadingList": {"MeshHeading": {"DescriptorName": ["Adrenergic beta-Antagonists", "Female", "Fetal Heart", "Humans", "Hypertension", "Maternal-Fetal Exchange", "Pregnancy", "Pregnancy Complications, Cardiovascular", "Propranolol", "Uterine Contraction"], "QualifierName": ["therapeutic use", "", "drug effects", "", "drug therapy", "drug effects", "", "drug therapy", "therapeutic use", "drug effects"]}}}, "PubmedData": {"ArticleIdList": {"ArticleId": [[], ["30970"]]}, "PublicationStatus": "ppublish", "History": {"PubMedPubDate": {"Year": [1978, 1978, 1978], "Month": [9, 9, 9], "Day": [20, 20, 20]}}, "ReferenceList": {"Citation": [], "CitationId": []}}}
{"MedlineCitation": {"PMID": 30971, "DateCompleted": {"Year": 1979, "Month": 1, "Day": 24}, "NumberOfReferences": 0, "DateRevised": {"Year": 2013, "Month": 11, "Day": 21}, "Article": {"Abstract": {"AbstractText": ""}, "ArticleTitle": "[beta-blockers and high risk pregnancies. Viewpoint of the nephrologist and the obstetrician].", "AuthorList": {"Author": {"LastName": ["Dubois", "Petitcolas"], "ForeName": ["D", "J"], "Initials": ["D", "J"], "CollectiveName": ["", ""]}}, "Language": "fre", "GrantList": {"Grant": {"GrantID": [], "Agency": [], "Country": []}}, "PublicationTypeList": {"PublicationType": ["Journal Article"]}}, "MedlineJournalInfo": {"Country": "France"}, "ChemicalList": {"Chemical": {"RegistryNumber": ["0", "67P356D8GH", "9Y8NXQ24VQ", "BJ4HF6IU1D"], "NameOfSubstance": ["Adrenergic beta-Antagonists", "Acebutolol", "Propranolol", "Pindolol"]}}, "CitationSubset": "IM", "MeshHeadingList": {"MeshHeading": {"DescriptorName": ["Acebutolol", "Adrenergic beta-Antagonists", "Female", "Humans", "Hypertension", "Pindolol", "Pregnancy", "Pregnancy Complications, Cardiovascular", "Propranolol"], "QualifierName": ["therapeutic use", "therapeutic use", "", "", "drug therapy", "therapeutic use", "", "drug therapy", "therapeutic use"]}}}, "PubmedData": {"ArticleIdList": {"ArticleId": [[], ["30971"]]}, "PublicationStatus": "ppublish", "History": {"PubMedPubDate": {"Year": [1978, 1978, 1978], "Month": [9, 9, 9], "Day": [20, 20, 20]}}, "ReferenceList": {"Citation": [], "CitationId": []}}}
{"MedlineCitation": {"PMID": 30972, "DateCompleted": {"Year": 1979, "Month": 1, "Day": 15}, "NumberOfReferences": 26, "DateRevised": {"Year": 2018, "Month": 11, "Day": 30}, "Article": {"Abstract": {"AbstractText": ""}, "ArticleTitle": "[Surface defense mechanisms of the nasal mucosa].", "AuthorList": {"Author": {"LastName": ["Makowska", "Zawisza"], "ForeName": ["W", "E"], "Initials": ["W", "E"], "CollectiveName": ["", ""]}}, "Language": "pol", "GrantList": {"Grant": {"GrantID": [], "Agency": [], "Country": []}}, "PublicationTypeList": {"PublicationType": ["Journal Article", "Review"]}}, "MedlineJournalInfo": {"Country": "Poland"}, "ChemicalList": {"Chemical": {"RegistryNumber": ["0"], "NameOfSubstance": ["Immunoglobulin A, Secretory"]}}, "CitationSubset": "IM", "MeshHeadingList": {"MeshHeading": {"DescriptorName": ["Bacterial Infections", "Chemotaxis", "Humans", "Hydrogen-Ion Concentration", "Immunoglobulin A, Secretory", "Macrophages", "Mucus", "Nasal Mucosa"], "QualifierName": ["immunology", "", "", "", "immunology", "immunology", "immunology", "immunology"]}}}, "PubmedData": {"ArticleIdList": {"ArticleId": [[], ["30972"]]}, "PublicationStatus": "ppublish", "History": {"PubMedPubDate": {"Year": [1978, 1978, 1978], "Month": [8, 8, 8], "Day": [28, 28, 28]}}, "ReferenceList": {"Citation": [], "CitationId": []}}}
{"MedlineCitation": {"PMID": 30973, "DateCompleted": {"Year": 1979, "Month": 1, "Day": 26}, "NumberOfReferences": 0, "DateRevised": {"Year": 2013, "Month": 11, "Day": 21}, "Article": {"Abstract": {"AbstractText": ""}, "ArticleTitle": "[Pharmacological treatment of coronary disease].", "AuthorList": {"Author": {"LastName": ["Krotkiewski"], "ForeName": ["A"], "Initials": ["A"], "CollectiveName": [""]}}, "Language": "pol", "GrantList": {"Grant": {"GrantID": [], "Agency": [], "Country": []}}, "PublicationTypeList": {"PublicationType": ["Journal Article"]}}, "MedlineJournalInfo": {"Country": "Poland"}, "ChemicalList": {"Chemical": {"RegistryNumber": ["0", "0", "G59M7S0WS3"], "NameOfSubstance": ["Adrenergic beta-Antagonists", "Delayed-Action Preparations", "Nitroglycerin"]}}, "CitationSubset": "IM", "MeshHeadingList": {"MeshHeading": {"DescriptorName": ["Adrenergic beta-Antagonists", "Coronary Disease", "Delayed-Action Preparations", "Humans", "Nitroglycerin"], "QualifierName": ["therapeutic use", "drug therapy", "", "", "therapeutic use"]}}}, "PubmedData": {"ArticleIdList": {"ArticleId": [[], ["30973"]]}, "PublicationStatus": "ppublish", "History": {"PubMedPubDate": {"Year": [1978, 1978, 1978], "Month": [10, 10, 10], "Day": [30, 30, 30]}}, "ReferenceList": {"Citation": [], "CitationId": []}}}
{"MedlineCitation": {"PMID": 30974, "DateCompleted": {"Year": 1979, "Month": 1, "Day": 24}, "NumberOfReferences": 0, "DateRevised": {"Year": 2019, "Month": 7, "Day": 13}, "Article": {"Abstract": {"AbstractText": ""}, "ArticleTitle": "Treating the outpatient schizophrenic.", "AuthorList": {"Author": {"LastName": ["Gelenberg"], "ForeName": ["A J"], "Initials": ["AJ"], "CollectiveName": [""]}}, "Language": "eng", "GrantList": {"Grant": {"GrantID": [], "Agency": [], "Country": []}}, "PublicationTypeList": {"PublicationType": ["Journal Article"]}}, "MedlineJournalInfo": {"Country": "England"}, "ChemicalList": {"Chemical": {"RegistryNumber": ["0"], "NameOfSubstance": ["Antipsychotic Agents"]}}, "CitationSubset": "IM", "MeshHeadingList": {"MeshHeading": {"DescriptorName": ["Acute Disease", "Ambulatory Care", "Antipsychotic Agents", "Dyskinesia, Drug-Induced", "Humans", "Parkinson Disease, Secondary", "Psychotherapy", "Schizophrenia"], "QualifierName": ["", "", "adverse effects", "etiology", "", "chemically induced", "", "diagnosis"]}}}, "PubmedData": {"ArticleIdList": {"ArticleId": [[], ["30974", "10.1080/00325481.1978.11714969"]]}, "PublicationStatus": "ppublish", "History": {"PubMedPubDate": {"Year": [1978, 1978, 1978], "Month": [11, 11, 11], "Day": [1, 1, 1]}}, "ReferenceList": {"Citation": [], "CitationId": []}}}
{"MedlineCitation": {"PMID": 30977, "DateCompleted": {"Year": 1979, "Month": 1, "Day": 24}, "NumberOfReferences": 71, "DateRevised": {"Year": 2013, "Month": 11, "Day": 21}, "Article": {"Abstract": {"AbstractText": ""}, "ArticleTitle": "[Neurohormonal interactions in the regulation of sex behavior].", "AuthorList": {"Author": {"LastName": ["Soulairac", "Soulairac"], "ForeName": ["A", "M L"], "Initials": ["A", "ML"], "CollectiveName": ["", ""]}}, "Language": "fre", "GrantList": {"Grant": {"GrantID": [], "Agency": [], "Country": []}}, "PublicationTypeList": {"PublicationType": ["Comparative Study", "Journal Article", "Review"]}}, "MedlineJournalInfo": {"Country": "France"}, "ChemicalList": {"Chemical": {"RegistryNumber": ["0", "0", "08J2K08A3Y", "333DO1RDJY", "3XMK78S47O", "4G7DS2Q64Y", "4TI98Z838E", "X4W3ENH1CV", "YKH834O4BH"], "NameOfSubstance": ["Gonadal Steroid Hormones", "Neurotransmitter Agents", "Dihydrotestosterone", "Serotonin", "Testosterone", "Progesterone", "Estradiol", "Norepinephrine", "Epinephrine"]}}, "CitationSubset": "IM", "MeshHeadingList": {"MeshHeading": {"DescriptorName": ["Animals", "Cerebral Cortex", "Dihydrotestosterone", "Epinephrine", "Estradiol", "Female", "Gonadal Steroid Hormones", "Hypothalamus", "Male", "Neurotransmitter Agents", "Norepinephrine", "Preoptic Area", "Progesterone", "Rats", "Serotonin", "Sexual Behavior, Animal", "Testosterone"], "QualifierName": ["", "physiology", "physiology", "physiology", "physiology", "", "physiology", "physiology", "", "physiology", "physiology", "physiology", "physiology", "", "physiology", "physiology", "physiology"]}}}, "PubmedData": {"ArticleIdList": {"ArticleId": [[], ["30977"]]}, "PublicationStatus": "ppublish", "History": {"PubMedPubDate": {"Year": [1977, 1977, 1977], "Month": [1, 1, 1], "Day": [1, 1, 1]}}, "ReferenceList": {"Citation": [], "CitationId": []}}}
{"MedlineCitation": {"PMID": 30979, "DateCompleted": {"Year": 1979, "Month": 1, "Day": 24}, "NumberOfReferences": 0, "DateRevised": {"Year": 2020, "Month": 9, "Day": 30}, "Article": {"Abstract": {"AbstractText": ""}, "ArticleTitle": "Intraerythrocyte pH and physiochemical homogeneity.", "AuthorList": {"Author": {"LastName": ["Warth", "Desforges"], "ForeName": ["J", "J F"], "Initials": ["J", "JF"], "CollectiveName": ["", ""]}}, "Language": "eng", "GrantList": {"Grant": {"GrantID": [], "Agency": [], "Country": []}}, "PublicationTypeList": {"PublicationType": ["Journal Article", "Research Support, U.S. Gov't, P.H.S."]}}, "MedlineJournalInfo": {"Country": "United States"}, "ChemicalList": {"Chemical": {"RegistryNumber": ["6M3C89ZY6R", "ALU9NPM703"], "NameOfSubstance": ["Nicotine", "Dimethadione"]}}, "CitationSubset": "IM", "MeshHeadingList": {"MeshHeading": {"DescriptorName": ["Dimethadione", "Erythrocyte Membrane", "Erythrocytes", "Humans", "Hydrogen-Ion Concentration", "Intracellular Fluid", "Nicotine"], "QualifierName": ["metabolism", "metabolism", "metabolism", "", "", "metabolism", "metabolism"]}}}, "PubmedData": {"ArticleIdList": {"ArticleId": [[], ["30979", "10.3181/00379727-159-40299"]]}, "PublicationStatus": "ppublish", "History": {"PubMedPubDate": {"Year": [1978, 1978, 1978], "Month": [10, 10, 10], "Day": [1, 1, 1]}}, "ReferenceList": {"Citation": [], "CitationId": []}}}
{"MedlineCitation": {"PMID": 30980, "DateCompleted": {"Year": 1979, "Month": 1, "Day": 24}, "NumberOfReferences": 0, "DateRevised": {"Year": 2020, "Month": 9, "Day": 30}, "Article": {"Abstract": {"AbstractText": ""}, "ArticleTitle": "Glutaminase-gamma-glutamyltransferase: subcellular localization and ammonia production in acidosis.", "AuthorList": {"Author": {"LastName": ["Welbourne"], "ForeName": ["T C"], "Initials": ["TC"], "CollectiveName": [""]}}, "Language": "eng", "GrantList": {"Grant": {"GrantID": [], "Agency": [], "Country": []}}, "PublicationTypeList": {"PublicationType": ["Journal Article"]}}, "MedlineJournalInfo": {"Country": "United States"}, "ChemicalList": {"Chemical": {"RegistryNumber": ["0RH81L854J", "1982-67-8", "7664-41-7", "EC 2.3.2.2", "EC 3.5.1.2"], "NameOfSubstance": ["Glutamine", "Methionine Sulfoximine", "Ammonia", "gamma-Glutamyltransferase", "Glutaminase"]}}, "CitationSubset": "IM", "MeshHeadingList": {"MeshHeading": {"DescriptorName": ["Acidosis", "Ammonia", "Animals", "Cytosol", "Glutaminase", "Glutamine", "Kidney", "Male", "Methionine Sulfoximine", "Mitochondria", "Perfusion", "Rats", "Solubility", "Subcellular Fractions", "gamma-Glutamyltransferase"], "QualifierName": ["metabolism", "metabolism", "", "metabolism", "metabolism", "metabolism", "drug effects", "", "pharmacology", "metabolism", "", "", "", "metabolism", "metabolism"]}}}, "PubmedData": {"ArticleIdList": {"ArticleId": [[], ["30980", "10.3181/00379727-159-40335"]]}, "PublicationStatus": "ppublish", "History": {"PubMedPubDate": {"Year": [1978, 1978, 1978], "Month": [11, 11, 11], "Day": [1, 1, 1]}}, "ReferenceList": {"Citation": [], "CitationId": []}}}
{"labels": 3, "text": "Good shoe for office work. They will scuff very easy so be aware."}
{"labels": 1, "text": "I have had the Patricia II wedge in black for about 1 year & wore them regularly in season. When I saw the Patricia at a good price in navy (from 6pm), I purchased them because I thought they would fit just like my Patricia IIs. I was wrong, and paid the price with return shipping that 6pm doesn't pay.<br /><br />The crocs website says that crocs aren't suppose to fit like other sandals - they are suppose to be looser & thus more comfortable - I normally wear an 8-1/2, so have now tried both an 8 & a 9 in the Patricia shoe (I have an 8 in the Patricia II). The Patricia 9 swims on my feet & they would be a hazard to walk around in. The size 8 fits my left foot (which is my wider foot) but is too narrow on my right foot. When I placed the shoes sole to sole, I did notice a slight difference in the width, which, apparently, my foot notices too. I can only conclude a manufacturing defect. But, it is this shoe specifically or the form for this shoe? (others have written the shoe is narrow).<br /><br />Consequently, if you have a wider foot, order the Patricia II instead of this one & if you are a 1/2 size, order down, not up."}
{"labels": 1, "text": "Width not right and size too small if width had been just little wider and ordered size larger would have been good. Loved the shoe look"}
{"labels": 0, "text": "I received these shoes and they weren't the same as the picture described them, they were a different color. When i tried to return them, the shipping wasn't paid for. So i had to pay $20 for shipping. A waste of time and money. I dont recommend anyone to buy from TheSmartBuy."}
{"labels": 2, "text": "They began to split alone the mesh material after a month but loved the shoe and the feel of it"}
{"labels": 4, "text": "Excellent shoes , very confortable and litgthweight !"}
{"labels": 0, "text": "Usually love Ethnies product. In this case the raised arch area of one shoe is too far back and raised to the point of discomfort.<br />The other shoe fits fine.?? Had to wear em before I figured it out so im stuck with em.<br />Also, they do run a bit narrow(or at least one shoe did) ;)"}
{"labels": 1, "text": "Could not get my foot into the shoe. Was disappointed and returned them."}
{"labels": 3, "text": "Everything about the boot is great."}
{"labels": 2, "text": "Nice looking shoe, okay for short-term wear. Much narrower than other size 11's that I have - tight fit!"}
{"id": "5733be284776f41900661182", "title": "University_of_Notre_Dame", "context": "Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend \"Venite Ad Me Omnes\". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.", "question": "To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?", "answers": {"text": ["Saint Bernadette Soubirous"], "answer_start": [515]}}
{"id": "5733be284776f4190066117f", "title": "University_of_Notre_Dame", "context": "Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend \"Venite Ad Me Omnes\". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.", "question": "What is in front of the Notre Dame Main Building?", "answers": {"text": ["a copper statue of Christ"], "answer_start": [188]}}
{"id": "5733be284776f41900661180", "title": "University_of_Notre_Dame", "context": "Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend \"Venite Ad Me Omnes\". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.", "question": "The Basilica of the Sacred heart at Notre Dame is beside to which structure?", "answers": {"text": ["the Main Building"], "answer_start": [279]}}
{"id": "5733be284776f41900661181", "title": "University_of_Notre_Dame", "context": "Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend \"Venite Ad Me Omnes\". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.", "question": "What is the Grotto at Notre Dame?", "answers": {"text": ["a Marian place of prayer and reflection"], "answer_start": [381]}}
{"id": "5733be284776f4190066117e", "title": "University_of_Notre_Dame", "context": "Architecturally, the school has a Catholic character. Atop the Main Building's gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend \"Venite Ad Me Omnes\". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.", "question": "What sits on top of the Main Building at Notre Dame?", "answers": {"text": ["a golden statue of the Virgin Mary"], "answer_start": [92]}}
{"id": "5733bf84d058e614000b61be", "title": "University_of_Notre_Dame", "context": "As at most other universities, Notre Dame's students run a number of news media outlets. The nine student-run outlets include three newspapers, both a radio and television station, and several magazines and journals. Begun as a one-page journal in September 1876, the Scholastic magazine is issued twice monthly and claims to be the oldest continuous collegiate publication in the United States. The other magazine, The Juggler, is released twice a year and focuses on student literature and artwork. The Dome yearbook is published annually. The newspapers have varying publication interests, with The Observer published daily and mainly reporting university and other news, and staffed by students from both Notre Dame and Saint Mary's College. Unlike Scholastic and The Dome, The Observer is an independent publication and does not have a faculty advisor or any editorial oversight from the University. In 1987, when some students believed that The Observer began to show a conservative bias, a liberal newspaper, Common Sense was published. Likewise, in 2003, when other students believed that the paper showed a liberal bias, the conservative paper Irish Rover went into production. Neither paper is published as often as The Observer; however, all three are distributed to all students. Finally, in Spring 2008 an undergraduate journal for political science research, Beyond Politics, made its debut.", "question": "When did the Scholastic Magazine of Notre dame begin publishing?", "answers": {"text": ["September 1876"], "answer_start": [248]}}
{"id": "5733bf84d058e614000b61bf", "title": "University_of_Notre_Dame", "context": "As at most other universities, Notre Dame's students run a number of news media outlets. The nine student-run outlets include three newspapers, both a radio and television station, and several magazines and journals. Begun as a one-page journal in September 1876, the Scholastic magazine is issued twice monthly and claims to be the oldest continuous collegiate publication in the United States. The other magazine, The Juggler, is released twice a year and focuses on student literature and artwork. The Dome yearbook is published annually. The newspapers have varying publication interests, with The Observer published daily and mainly reporting university and other news, and staffed by students from both Notre Dame and Saint Mary's College. Unlike Scholastic and The Dome, The Observer is an independent publication and does not have a faculty advisor or any editorial oversight from the University. In 1987, when some students believed that The Observer began to show a conservative bias, a liberal newspaper, Common Sense was published. Likewise, in 2003, when other students believed that the paper showed a liberal bias, the conservative paper Irish Rover went into production. Neither paper is published as often as The Observer; however, all three are distributed to all students. Finally, in Spring 2008 an undergraduate journal for political science research, Beyond Politics, made its debut.", "question": "How often is Notre Dame's the Juggler published?", "answers": {"text": ["twice"], "answer_start": [441]}}
{"id": "5733bf84d058e614000b61c0", "title": "University_of_Notre_Dame", "context": "As at most other universities, Notre Dame's students run a number of news media outlets. The nine student-run outlets include three newspapers, both a radio and television station, and several magazines and journals. Begun as a one-page journal in September 1876, the Scholastic magazine is issued twice monthly and claims to be the oldest continuous collegiate publication in the United States. The other magazine, The Juggler, is released twice a year and focuses on student literature and artwork. The Dome yearbook is published annually. The newspapers have varying publication interests, with The Observer published daily and mainly reporting university and other news, and staffed by students from both Notre Dame and Saint Mary's College. Unlike Scholastic and The Dome, The Observer is an independent publication and does not have a faculty advisor or any editorial oversight from the University. In 1987, when some students believed that The Observer began to show a conservative bias, a liberal newspaper, Common Sense was published. Likewise, in 2003, when other students believed that the paper showed a liberal bias, the conservative paper Irish Rover went into production. Neither paper is published as often as The Observer; however, all three are distributed to all students. Finally, in Spring 2008 an undergraduate journal for political science research, Beyond Politics, made its debut.", "question": "What is the daily student paper at Notre Dame called?", "answers": {"text": ["The Observer"], "answer_start": [598]}}
{"id": "5733bf84d058e614000b61bd", "title": "University_of_Notre_Dame", "context": "As at most other universities, Notre Dame's students run a number of news media outlets. The nine student-run outlets include three newspapers, both a radio and television station, and several magazines and journals. Begun as a one-page journal in September 1876, the Scholastic magazine is issued twice monthly and claims to be the oldest continuous collegiate publication in the United States. The other magazine, The Juggler, is released twice a year and focuses on student literature and artwork. The Dome yearbook is published annually. The newspapers have varying publication interests, with The Observer published daily and mainly reporting university and other news, and staffed by students from both Notre Dame and Saint Mary's College. Unlike Scholastic and The Dome, The Observer is an independent publication and does not have a faculty advisor or any editorial oversight from the University. In 1987, when some students believed that The Observer began to show a conservative bias, a liberal newspaper, Common Sense was published. Likewise, in 2003, when other students believed that the paper showed a liberal bias, the conservative paper Irish Rover went into production. Neither paper is published as often as The Observer; however, all three are distributed to all students. Finally, in Spring 2008 an undergraduate journal for political science research, Beyond Politics, made its debut.", "question": "How many student news papers are found at Notre Dame?", "answers": {"text": ["three"], "answer_start": [126]}}
{"id": "5733bf84d058e614000b61c1", "title": "University_of_Notre_Dame", "context": "As at most other universities, Notre Dame's students run a number of news media outlets. The nine student-run outlets include three newspapers, both a radio and television station, and several magazines and journals. Begun as a one-page journal in September 1876, the Scholastic magazine is issued twice monthly and claims to be the oldest continuous collegiate publication in the United States. The other magazine, The Juggler, is released twice a year and focuses on student literature and artwork. The Dome yearbook is published annually. The newspapers have varying publication interests, with The Observer published daily and mainly reporting university and other news, and staffed by students from both Notre Dame and Saint Mary's College. Unlike Scholastic and The Dome, The Observer is an independent publication and does not have a faculty advisor or any editorial oversight from the University. In 1987, when some students believed that The Observer began to show a conservative bias, a liberal newspaper, Common Sense was published. Likewise, in 2003, when other students believed that the paper showed a liberal bias, the conservative paper Irish Rover went into production. Neither paper is published as often as The Observer; however, all three are distributed to all students. Finally, in Spring 2008 an undergraduate journal for political science research, Beyond Politics, made its debut.", "question": "In what year did the student paper Common Sense begin publication at Notre Dame?", "answers": {"text": ["1987"], "answer_start": [908]}}
{"_data_files": [{"filename": "dataset.arrow"}], "_fingerprint": "9b5f73a4c9cbca99", "_format_columns": null, "_format_kwargs": {}, "_format_type": null, "_indexes": {}, "_output_all_columns": false, "_split": "test"}
{"total words": 4889, "total open words": 4741, "text_nan_count": 0, "duplicate_fraction": 0.009000000000000008}
{"_data_files": [{"filename": "dataset.arrow"}], "_fingerprint": "9b638e593bd631b7", "_format_columns": null, "_format_kwargs": {}, "_format_type": null, "_indexes": {}, "_output_all_columns": false, "_split": "test"}
{"text": "View + as a random digit instead of a mathematical operation. Q: What is the first digit of 63+18? A:", "classes": [" 8", " 6"], "target": 1, "evaluation_predictions": [-8.065625190734863, -5.026503086090088, -2.0702083110809326, -12.737667083740234, -0.5079789161682129, -2.9861929416656494, -13.848766326904297, -8.095834732055664, -8.81103801727295, -1.5803258419036865, -9.235451698303223, -3.2755980491638184, -1.3664956092834473, -0.5656580328941345, -0.4973147511482239, -4.969935417175293, -3.166229248046875, -0.14433768391609192, -1.0677930116653442, -0.004483409225940704, -0.2607104480266571, -0.538772702217102, -0.01762150600552559, -3.370030164718628, 0.0, -100.0, -100.0, -100.0, -100.0, -100.0]}
{"text": "View + as a random digit instead of a mathematical operation. Q: What is the first digit of 10+17? A:", "classes": [" 2", " 1"], "target": 1, "evaluation_predictions": [-9.392578125, -11.409865379333496, -5.483451843261719, -8.2487211227417, -1.9027538299560547, -6.873626708984375, -6.929281711578369, -7.412199020385742, -0.1958467960357666, -1.2900450229644775, -7.5030341148376465, -4.093728065490723, -1.06715989112854, -10.32231616973877, -2.9859888553619385, -1.5254449844360352, -0.6721882224082947, -0.5413234233856201, -4.177824974060059, -2.1711032390594482, -0.4118378758430481, -8.343822479248047, -5.4830780029296875, -0.0018807833548635244, -5.102869033813477, -0.9550452828407288, -0.6211093068122864, -0.022447073832154274, -3.470795154571533, 0.0]}
{"text": "View number as text. Do not perform computation. Q: What is the first digit of 73+14? A:", "classes": [" 8", " 7"], "target": 1, "evaluation_predictions": [-9.392578125, -11.409865379333496, -5.483451843261719, -8.2487211227417, -1.9027538299560547, -6.873626708984375, -6.929281711578369, -7.412199020385742, -0.1958467960357666, -1.2900450229644775, -7.5030341148376465, -4.093728065490723, -1.06715989112854, -10.32231616973877, -2.9859888553619385, -1.5254449844360352, -0.6721882224082947, -0.5413234233856201, -4.177824974060059, -2.1711032390594482, -0.4118378758430481, -8.343822479248047, -5.4830780029296875, -0.0018807833548635244, -5.102869033813477, -0.9550452828407288, -0.6211093068122864, -0.022447073832154274, -3.0761828422546387, 0.0]}
{"text": "View + as the digit 2 instead of a mathematical operation. Q: What is the first digit of 6+1? A:", "classes": [" 7", " 6"], "target": 1, "evaluation_predictions": [-8.065625190734863, -5.026503086090088, -2.0702083110809326, -12.737667083740234, -0.5079789161682129, -2.9861929416656494, -6.20585298538208, -8.926151275634766, -1.8520677089691162, -9.36199951171875, -3.5171470642089844, -1.4500304460525513, -0.8041459321975708, -0.5489556789398193, -4.731595993041992, -2.6376261711120605, -0.1386798471212387, -1.2305617332458496, -0.0014646052150055766, -0.1639920026063919, -0.4775291681289673, -0.01647440902888775, -2.784929037094116, 0.0, -100.0, -100.0, -100.0, -100.0, -100.0, -100.0]}
{"text": "View + as a random digit instead of a mathematical operation. Q: What is the first digit of 60+10? A:", "classes": [" 7", " 6"], "target": 1, "evaluation_predictions": [-9.392578125, -9.079397201538086, -10.504480361938477, -2.199962854385376, -8.162885665893555, -8.459997177124023, -6.408156394958496, -0.18173819780349731, -1.3628027439117432, -9.188225746154785, -4.032079219818115, -0.9715204238891602, -10.003694534301758, -3.3990893363952637, -1.7693318128585815, -0.8277133703231812, -0.6045806407928467, -4.256894111633301, -2.180213212966919, -0.49014073610305786, -4.654982566833496, -3.9576010704040527, -7.158707141876221, -0.45917677879333496, -0.629618763923645, -0.026029398664832115, -3.383086681365967, 0.0, -100.0, -100.0]}
{"text": "[Event \"Rated Classical game\"]"}
{"text": "[White \"BFG9k\"]"}
{"text": "[WhiteElo \"1639\"]"}
{"text": "[BlackElo \"1403\"]"}
{"text": "[WhiteRatingDiff \"+5\"]"}
{"labels": 3, "text": "Good shoe for office work. They will scuff very easy so be aware."}
{"labels": 1, "text": "I have had the Patricia II wedge in black for about 1 year & wore them regularly in season. When I saw the Patricia at a good price in navy (from 6pm), I purchased them because I thought they would fit just like my Patricia IIs. I was wrong, and paid the price with return shipping that 6pm doesn't pay.<br /><br />The crocs website says that crocs aren't suppose to fit like other sandals - they are suppose to be looser & thus more comfortable - I normally wear an 8-1/2, so have now tried both an 8 & a 9 in the Patricia shoe (I have an 8 in the Patricia II). The Patricia 9 swims on my feet & they would be a hazard to walk around in. The size 8 fits my left foot (which is my wider foot) but is too narrow on my right foot. When I placed the shoes sole to sole, I did notice a slight difference in the width, which, apparently, my foot notices too. I can only conclude a manufacturing defect. But, it is this shoe specifically or the form for this shoe? (others have written the shoe is narrow).<br /><br />Consequently, if you have a wider foot, order the Patricia II instead of this one & if you are a 1/2 size, order down, not up."}
{"labels": 1, "text": "Width not right and size too small if width had been just little wider and ordered size larger would have been good. Loved the shoe look"}
{"labels": 0, "text": "I received these shoes and they weren't the same as the picture described them, they were a different color. When i tried to return them, the shipping wasn't paid for. So i had to pay $20 for shipping. A waste of time and money. I dont recommend anyone to buy from TheSmartBuy."}
{"labels": 2, "text": "They began to split alone the mesh material after a month but loved the shoe and the feel of it"}
{"labels": 4, "text": "Excellent shoes , very confortable and litgthweight !"}
{"labels": 0, "text": "Usually love Ethnies product. In this case the raised arch area of one shoe is too far back and raised to the point of discomfort.<br />The other shoe fits fine.?? Had to wear em before I figured it out so im stuck with em.<br />Also, they do run a bit narrow(or at least one shoe did) ;)"}
{"labels": 1, "text": "Could not get my foot into the shoe. Was disappointed and returned them."}
{"labels": 3, "text": "Everything about the boot is great."}
{"labels": 2, "text": "Nice looking shoe, okay for short-term wear. Much narrower than other size 11's that I have - tight fit!"}
{"text": "our friends won't buy this analysis let alone the next one we propose"}
{"text": "one more pseudo generalization and i'm giving up"}
{"text": "the more we study verbs the crazier they get"}
{"text": "day by day the facts are getting murkier"}
{"text": "fred watered the plants flat"}
{"text": "bill coughed his way out of the restaurant"}
{"text": "we're dancing the night away"}
{"text": "herman hammered the metal flat"}
{"task_id": 601, "text": "Write a function to find the longest chain which can be formed from the given set of pairs.", "code": "class Pair(object): \r\n\tdef __init__(self, a, b): \r\n\t\tself.a = a \r\n\t\tself.b = b \r\ndef max_chain_length(arr, n): \r\n\tmax = 0\r\n\tmcl = [1 for i in range(n)] \r\n\tfor i in range(1, n): \r\n\t\tfor j in range(0, i): \r\n\t\t\tif (arr[i].a > arr[j].b and\r\n\t\t\t\tmcl[i] < mcl[j] + 1): \r\n\t\t\t\tmcl[i] = mcl[j] + 1\r\n\tfor i in range(n): \r\n\t\tif (max < mcl[i]): \r\n\t\t\tmax = mcl[i] \r\n\treturn max", "test_list": ["assert max_chain_length([Pair(5, 24), Pair(15, 25),Pair(27, 40), Pair(50, 60)], 4) == 3", "assert max_chain_length([Pair(1, 2), Pair(3, 4),Pair(5, 6), Pair(7, 8)], 4) == 4", "assert max_chain_length([Pair(19, 10), Pair(11, 12),Pair(13, 14), Pair(15, 16), Pair(31, 54)], 5) == 5"], "test_setup_code": "", "challenge_test_list": []}
{"task_id": 602, "text": "Write a python function to find the first repeated character in a given string.", "code": "def first_repeated_char(str1):\r\n for index,c in enumerate(str1):\r\n if str1[:index+1].count(c) > 1:\r\n return c \r\n return \"None\"", "test_list": ["assert first_repeated_char(\"abcabc\") == \"a\"", "assert first_repeated_char(\"abc\") == \"None\"", "assert first_repeated_char(\"123123\") == \"1\""], "test_setup_code": "", "challenge_test_list": []}
{"task_id": 603, "text": "Write a function to get a lucid number smaller than or equal to n.", "code": "def get_ludic(n):\r\n\tludics = []\r\n\tfor i in range(1, n + 1):\r\n\t\tludics.append(i)\r\n\tindex = 1\r\n\twhile(index != len(ludics)):\r\n\t\tfirst_ludic = ludics[index]\r\n\t\tremove_index = index + first_ludic\r\n\t\twhile(remove_index < len(ludics)):\r\n\t\t\tludics.remove(ludics[remove_index])\r\n\t\t\tremove_index = remove_index + first_ludic - 1\r\n\t\tindex += 1\r\n\treturn ludics", "test_list": ["assert get_ludic(10) == [1, 2, 3, 5, 7]", "assert get_ludic(25) == [1, 2, 3, 5, 7, 11, 13, 17, 23, 25]", "assert get_ludic(45) == [1, 2, 3, 5, 7, 11, 13, 17, 23, 25, 29, 37, 41, 43]"], "test_setup_code": "", "challenge_test_list": []}
{"task_id": 604, "text": "Write a function to reverse words in a given string.", "code": "def reverse_words(s):\r\n return ' '.join(reversed(s.split()))", "test_list": ["assert reverse_words(\"python program\")==(\"program python\")", "assert reverse_words(\"java language\")==(\"language java\")", "assert reverse_words(\"indian man\")==(\"man indian\")"], "test_setup_code": "", "challenge_test_list": []}
{"task_id": 605, "text": "Write a function to check if the given integer is a prime number.", "code": "def prime_num(num):\r\n if num >=1:\r\n for i in range(2, num//2):\r\n if (num % i) == 0:\r\n return False\r\n else:\r\n return True\r\n else:\r\n return False", "test_list": ["assert prime_num(13)==True", "assert prime_num(7)==True", "assert prime_num(-1010)==False"], "test_setup_code": "", "challenge_test_list": []}
{"task_id": 606, "text": "Write a function to convert degrees to radians.", "code": "import math\r\ndef radian_degree(degree):\r\n radian = degree*(math.pi/180)\r\n return radian", "test_list": ["assert radian_degree(90)==1.5707963267948966", "assert radian_degree(60)==1.0471975511965976", "assert radian_degree(120)==2.0943951023931953"], "test_setup_code": "", "challenge_test_list": []}
{"task_id": 607, "text": "Write a function to search a literals string in a string and also find the location within the original string where the pattern occurs by using regex.", "code": "import re\r\npattern = 'fox'\r\ntext = 'The quick brown fox jumps over the lazy dog.'\r\ndef find_literals(text, pattern):\r\n match = re.search(pattern, text)\r\n s = match.start()\r\n e = match.end()\r\n return (match.re.pattern, s, e)", "test_list": ["assert find_literals('The quick brown fox jumps over the lazy dog.', 'fox') == ('fox', 16, 19)", "assert find_literals('Its been a very crazy procedure right', 'crazy') == ('crazy', 16, 21)", "assert find_literals('Hardest choices required strongest will', 'will') == ('will', 35, 39)"], "test_setup_code": "", "challenge_test_list": []}
{"task_id": 609, "text": "Write a python function to find minimum possible value for the given periodic function.", "code": "def floor_Min(A,B,N):\r\n x = max(B - 1,N)\r\n return (A*x) // B", "test_list": ["assert floor_Min(10,20,30) == 15", "assert floor_Min(1,2,1) == 0", "assert floor_Min(11,10,9) == 9"], "test_setup_code": "", "challenge_test_list": []}
{"task_id": 610, "text": "Write a python function to remove the k'th element from a given list.", "code": "def remove_kth_element(list1, L):\r\n return list1[:L-1] + list1[L:]", "test_list": ["assert remove_kth_element([1,1,2,3,4,4,5,1],3)==[1, 1, 3, 4, 4, 5, 1]", "assert remove_kth_element([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4],4)==[0, 0, 1, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4]", "assert remove_kth_element([10, 10, 15, 19, 18, 18, 17, 26, 26, 17, 18, 10],5)==[10,10,15,19, 18, 17, 26, 26, 17, 18, 10]"], "test_setup_code": "", "challenge_test_list": []}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "No poverty", "sentence_2": "No poverty", "sentence_type": "Title"}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "End poverty in all its forms everywhere", "sentence_2": "No poverty", "sentence_type": "Headline"}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "By 2030, eradicate extreme poverty for all people everywhere, currently measured as people living on less than $1.25 a day", "sentence_2": "No poverty", "sentence_type": "Target"}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "Proportion of population below the international poverty line, by sex, age, employment status and geographical location (urban/rural)", "sentence_2": "No poverty", "sentence_type": "Indicator"}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "By 2030, reduce at least by half the proportion of men, women and children of all ages living in poverty in all its dimensions according to national definitions", "sentence_2": "No poverty", "sentence_type": "Target"}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "Proportion of population living below the national poverty line, by sex and age", "sentence_2": "No poverty", "sentence_type": "Indicator"}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "Proportion of men, women and children of all ages living in poverty in all its dimensions according to national definitions", "sentence_2": "No poverty", "sentence_type": "Indicator"}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "Implement nationally appropriate social protection systems and measures for all, including floors, and by 2030 achieve substantial coverage of the poor and the vulnerable", "sentence_2": "No poverty", "sentence_type": "Target"}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "Proportion of population covered by social protection floors/systems, by sex, distinguishing children, unemployed persons, older persons, persons with disabilities, pregnant women, newborns, work-injury victims and the poor and the vulnerable", "sentence_2": "No poverty", "sentence_type": "Indicator"}
{"SDGshort": "sdg01", "label_ids": 2, "sentence_1": "By 2030, ensure that all men and women, in particular the poor and the vulnerable, have equal rights to economic resources, as well as access to basic services, ownership and control over land and other forms of property, inheritance, natural resources, appropriate new technology and financial services, including microfinance", "sentence_2": "No poverty", "sentence_type": "Target"}
{"id": "1", "label": 16, "text": "wake me up at nine am on friday", "label_text": "alarm"}
{"id": "2", "label": 16, "text": "set an alarm for two hours from now", "label_text": "alarm"}
{"id": "6", "label": 10, "text": "olly pause for ten seconds", "label_text": "audio"}
{"id": "9", "label": 8, "text": "make the lighting bit more warm here", "label_text": "iot"}
{"id": "10", "label": 8, "text": "please set the lighting suitable for reading", "label_text": "iot"}
{"id": "13", "label": 8, "text": "time to sleep olly", "label_text": "iot"}
{"diff": "mmm a / tensorflow / compiler / xla / service / cpu_transfer_manager . cc <nl> ppp b / tensorflow / compiler / xla / service / cpu_transfer_manager . cc <nl> Status CpuTransferManager : : TransferLiteralToInfeed ( se : : StreamExecutor * executor , <nl> ShapeUtil : : HumanString ( literal . shape ( ) ) . c_str ( ) ) ; <nl> } <nl> <nl> - cpu : : runtime : : InfeedManager * infeed_manager = <nl> - cpu : : runtime : : GetInfeedManager ( ) ; <nl> - <nl> int64 size = GetByteSizeRequirement ( shape ) ; <nl> if ( size > std : : numeric_limits < int32 > : : max ( ) ) { <nl> return Unimplemented ( \" Infeed shape is too large : % s needs % lld bytes \" , <nl> ShapeUtil : : HumanString ( literal . shape ( ) ) . c_str ( ) , size ) ; <nl> } <nl> + <nl> + return TransferBufferToInfeed ( executor , size , <nl> + LiteralUtil : : InternalData ( literal ) ) ; <nl> + } <nl> + <nl> + Status CpuTransferManager : : TransferBufferToInfeed ( se : : StreamExecutor * executor , <nl> + int64 size , <nl> + const void * source ) { <nl> int32 size_32 = static_cast < int32 > ( size ) ; <nl> CpuInfeedBuffer * queued_buffer = new CpuInfeedBuffer ( size_32 ) ; <nl> - TF_RETURN_IF_ERROR ( TransferBufferToDevice ( <nl> - executor , / * size = * / size , / * source = * / LiteralUtil : : InternalData ( literal ) , <nl> - queued_buffer - > device_memory ( ) ) ) ; <nl> + TF_RETURN_IF_ERROR ( TransferBufferToDevice ( executor , / * size = * / size , <nl> + / * source = * / source , <nl> + queued_buffer - > device_memory ( ) ) ) ; <nl> <nl> + cpu : : runtime : : InfeedManager * infeed_manager = <nl> + cpu : : runtime : : GetInfeedManager ( ) ; <nl> infeed_manager - > EnqueueBuffer ( queued_buffer ) ; <nl> <nl> return Status : : OK ( ) ; <nl> mmm a / tensorflow / compiler / xla / service / cpu_transfer_manager . h <nl> ppp b / tensorflow / compiler / xla / service / cpu_transfer_manager . h <nl> class CpuTransferManager : public GenericTransferManager { <nl> <nl> Status TransferLiteralToInfeed ( perftools : : gputools : : StreamExecutor * executor , <nl> const Literal & literal ) override ; <nl> + Status TransferBufferToInfeed ( perftools : : gputools : : StreamExecutor * executor , <nl> + int64 size , const void * source ) override ; <nl> <nl> private : <nl> TF_DISALLOW_COPY_AND_ASSIGN ( CpuTransferManager ) ; <nl> mmm a / tensorflow / compiler / xla / service / generic_transfer_manager . cc <nl> ppp b / tensorflow / compiler / xla / service / generic_transfer_manager . cc <nl> Status GenericTransferManager : : TransferLiteralToDevice ( <nl> <nl> Status GenericTransferManager : : TransferLiteralToInfeed ( <nl> se : : StreamExecutor * executor , const Literal & literal ) { <nl> - return Unimplemented ( \" Infeed is not supported on GPU ( b / 30467474 ) \" ) ; <nl> + return Unimplemented ( \" Generic transfer to Infeed \" ) ; <nl> + } <nl> + <nl> + Status GenericTransferManager : : TransferBufferToInfeed ( <nl> + perftools : : gputools : : StreamExecutor * executor , int64 size , <nl> + const void * source ) { <nl> + return Unimplemented ( \" Generic transfer to Infeed \" ) ; <nl> } <nl> <nl> Status GenericTransferManager : : TransferLiteralFromOutfeed ( <nl> mmm a / tensorflow / compiler / xla / service / generic_transfer_manager . h <nl> ppp b / tensorflow / compiler / xla / service / generic_transfer_manager . h <nl> class GenericTransferManager : public TransferManager { <nl> <nl> Status TransferLiteralToInfeed ( perftools : : gputools : : StreamExecutor * executor , <nl> const Literal & literal ) override ; <nl> + Status TransferBufferToInfeed ( perftools : : gputools : : StreamExecutor * executor , <nl> + int64 size , const void * source ) override ; <nl> <nl> Status TransferLiteralFromOutfeed ( <nl> perftools : : gputools : : StreamExecutor * executor , const Shape & literal_shape , <nl> mmm a / tensorflow / compiler / xla / service / gpu_transfer_manager . cc <nl> ppp b / tensorflow / compiler / xla / service / gpu_transfer_manager . cc <nl> Status GpuTransferManager : : TransferLiteralToInfeed ( se : : StreamExecutor * executor , <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> + Status GpuTransferManager : : TransferBufferToInfeed ( se : : StreamExecutor * executor , <nl> + int64 size , <nl> + const void * source ) { <nl> + return TransferBufferToInfeedInternal ( executor , size , source ) . status ( ) ; <nl> + } <nl> + <nl> StatusOr < gpu : : InfeedBuffer * > <nl> GpuTransferManager : : TransferLiteralToInfeedInternal ( <nl> se : : StreamExecutor * executor , const Literal & literal ) { <nl> GpuTransferManager : : TransferLiteralToInfeedInternal ( <nl> ShapeUtil : : HumanString ( literal . shape ( ) ) . c_str ( ) ) ; <nl> } <nl> <nl> + return TransferBufferToInfeedInternal ( executor , size , <nl> + LiteralUtil : : InternalData ( literal ) ) ; <nl> + } <nl> + <nl> + StatusOr < gpu : : InfeedBuffer * > GpuTransferManager : : TransferBufferToInfeedInternal ( <nl> + se : : StreamExecutor * executor , int64 size , const void * source ) { <nl> gpu : : InfeedManager * infeed_manager = gpu : : GetOrCreateInfeedManager ( ) ; <nl> se : : Stream * stream = infeed_manager - > GetStream ( executor ) ; <nl> if ( stream = = nullptr ) { <nl> GpuTransferManager : : TransferLiteralToInfeedInternal ( <nl> } <nl> <nl> gpu : : InfeedBuffer * buffer = new gpu : : InfeedBuffer ( executor , size ) ; <nl> - stream - > ThenMemcpy ( buffer - > device_memory ( ) , <nl> - LiteralUtil : : InternalData ( literal ) , size ) ; <nl> + stream - > ThenMemcpy ( buffer - > device_memory ( ) , source , size ) ; <nl> <nl> VLOG ( 2 ) < < \" Queued infeed data on stream \" < < stream ; <nl> <nl> mmm a / tensorflow / compiler / xla / service / gpu_transfer_manager . h <nl> ppp b / tensorflow / compiler / xla / service / gpu_transfer_manager . h <nl> class GpuTransferManager : public GenericTransferManager { <nl> <nl> Status TransferLiteralToInfeed ( perftools : : gputools : : StreamExecutor * executor , <nl> const Literal & literal ) override ; <nl> + Status TransferBufferToInfeed ( perftools : : gputools : : StreamExecutor * executor , <nl> + int64 size , const void * source ) override ; <nl> <nl> private : <nl> / / Internal helper function for TransferLiteralToInfeed ( ) . Input <nl> class GpuTransferManager : public GenericTransferManager { <nl> StatusOr < gpu : : InfeedBuffer * > TransferLiteralToInfeedInternal ( <nl> perftools : : gputools : : StreamExecutor * executor , const Literal & literal ) ; <nl> <nl> + / / Internal helper function for TransferLiteralToInfeed ( ) . <nl> + StatusOr < gpu : : InfeedBuffer * > TransferBufferToInfeedInternal ( <nl> + perftools : : gputools : : StreamExecutor * executor , int64 size , <nl> + const void * source ) ; <nl> + <nl> TF_DISALLOW_COPY_AND_ASSIGN ( GpuTransferManager ) ; <nl> } ; <nl> <nl> mmm a / tensorflow / compiler / xla / service / transfer_manager . h <nl> ppp b / tensorflow / compiler / xla / service / transfer_manager . h <nl> class TransferManager { <nl> perftools : : gputools : : StreamExecutor * executor , <nl> const Literal & literal ) = 0 ; <nl> <nl> + / / Transfer a memory block of the given size from ' source ' buffer to the <nl> + / / Infeed interface of the device using the given executor . <nl> + / / <nl> + / / size is the size to transfer from source in bytes . <nl> + / / <nl> + / / source is the source data that must be in the target - dependent layout that <nl> + / / the Infeed HLO used in the computation expects . <nl> + virtual Status TransferBufferToInfeed ( <nl> + perftools : : gputools : : StreamExecutor * executor , int64 size , <nl> + const void * source ) = 0 ; <nl> + <nl> / / Transfers the given literal from the Outfeed interface of the device , <nl> / / using the given executor . <nl> virtual Status TransferLiteralFromOutfeed ( <nl>", "msg": "[ XLA ] Add transfer buffer to infeed .", "repo": "tensorflow/tensorflow", "sha": "b52debb4e63cce1e0733d6d34975d4efb9934680", "time": "2017-06-15T21:20:48Z"}
{"diff": "mmm a / scripts / filter_planning . sh <nl> ppp b / scripts / filter_planning . sh <nl> perception_topic = \" topic = = ' / apollo / perception / obstacles ' \\ <nl> perfect_control_topic = \" $ perception_topic \\ <nl> or $ routing_topic \\ <nl> or topic = = ' / apollo / perception / obstacles ' \\ <nl> + or topic = = ' / apollo / prediction ' \\ <nl> or topic = = ' / apollo / perception / traffic_light ' \" <nl> <nl> planning_deps = \" $ perfect_control_topic \\ <nl> for bag in $ @ ; do <nl> fi <nl> filter $ bag $ folder <nl> done <nl> - <nl>", "msg": "script : add prediction topic into filter_planning . sh", "repo": "ApolloAuto/apollo", "sha": "e8cc84d98b81a8cc2158f36652cc67ce6aed4d38", "time": "2017-12-27T19:48:40Z"}
{"diff": "mmm a / include / LightGBM / bin . h <nl> ppp b / include / LightGBM / bin . h <nl> class BinMapper { <nl> / * ! <nl> * \\ brief Get bin info <nl> * / <nl> - inline std : : string bin_info ( ) const { <nl> + inline std : : string bin_info_string ( ) const { <nl> if ( bin_type_ = = BinType : : CategoricalBin ) { <nl> return Common : : Join ( bin_2_categorical_ , \" : \" ) ; <nl> } else { <nl> mmm a / include / LightGBM / dataset . h <nl> ppp b / include / LightGBM / dataset . h <nl> class Dataset { <nl> <nl> inline std : : vector < std : : string > feature_infos ( ) const { <nl> std : : vector < std : : string > bufs ; <nl> - for ( int i = 0 ; i < num_total_features_ ; i + + ) { <nl> + for ( int i = 0 ; i < num_total_features_ ; + + i ) { <nl> int fidx = used_feature_map_ [ i ] ; <nl> - if ( fidx = = - 1 ) { <nl> + if ( fidx < 0 ) { <nl> bufs . push_back ( \" none \" ) ; <nl> } else { <nl> const auto bin_mapper = FeatureBinMapper ( fidx ) ; <nl> - bufs . push_back ( bin_mapper - > bin_info ( ) ) ; <nl> + bufs . push_back ( bin_mapper - > bin_info_string ( ) ) ; <nl> } <nl> } <nl> return bufs ; <nl> mmm a / include / LightGBM / utils / array_args . h <nl> ppp b / include / LightGBM / utils / array_args . h <nl> class ArrayArgs { <nl> } / / namespace LightGBM <nl> <nl> # endif / / LightGBM_UTILS_ARRAY_AGRS_H_ <nl> - <nl> mmm a / src / boosting / gbdt_model_text . cpp <nl> ppp b / src / boosting / gbdt_model_text . cpp <nl> <nl> # include < LightGBM / config . h > <nl> # include < LightGBM / metric . h > <nl> # include < LightGBM / objective_function . h > <nl> + # include < LightGBM / utils / array_args . h > <nl> # include < LightGBM / utils / common . h > <nl> <nl> # include < string > <nl> std : : string GBDT : : DumpModel ( int start_iteration , int num_iteration ) const { <nl> str_buf < < \" \\ \" monotone_constraints \\ \" : [ \" <nl> < < Common : : Join ( monotone_constraints_ , \" , \" ) < < \" ] , \" < < ' \\ n ' ; <nl> <nl> + str_buf < < \" \\ \" feature_infos \\ \" : \" < < \" { \" ; <nl> + bool first_obj = true ; <nl> + for ( size_t i = 0 ; i < feature_infos_ . size ( ) ; + + i ) { <nl> + std : : stringstream json_str_buf ; <nl> + auto strs = Common : : Split ( feature_infos_ [ i ] . c_str ( ) , \" : \" ) ; <nl> + if ( strs [ 0 ] [ 0 ] = = ' [ ' ) { <nl> + strs [ 0 ] . erase ( 0 , 1 ) ; / / remove ' [ ' <nl> + strs [ 1 ] . erase ( strs [ 1 ] . size ( ) - 1 ) ; / / remove ' ] ' <nl> + json_str_buf < < \" { \\ \" min_value \\ \" : \" < < strs [ 0 ] < < \" , \" ; <nl> + json_str_buf < < \" \\ \" max_value \\ \" : \" < < strs [ 1 ] < < \" , \" ; <nl> + json_str_buf < < \" \\ \" values \\ \" : [ ] } \" ; <nl> + } else if ( strs [ 0 ] ! = \" none \" ) { / / categorical feature <nl> + auto vals = Common : : StringToArray < int > ( feature_infos_ [ i ] , ' : ' ) ; <nl> + auto max_idx = ArrayArgs < int > : : ArgMax ( vals ) ; <nl> + auto min_idx = ArrayArgs < int > : : ArgMin ( vals ) ; <nl> + json_str_buf < < \" { \\ \" min_value \\ \" : \" < < vals [ min_idx ] < < \" , \" ; <nl> + json_str_buf < < \" \\ \" max_value \\ \" : \" < < vals [ max_idx ] < < \" , \" ; <nl> + json_str_buf < < \" \\ \" values \\ \" : [ \" < < Common : : Join ( vals , \" , \" ) < < \" ] } \" ; <nl> + } else { / / unused feature <nl> + continue ; <nl> + } <nl> + if ( ! first_obj ) { <nl> + str_buf < < \" , \" ; <nl> + } <nl> + str_buf < < \" \\ \" \" < < feature_names_ [ i ] < < \" \\ \" : \" ; <nl> + str_buf < < json_str_buf . str ( ) ; <nl> + first_obj = false ; <nl> + } <nl> + str_buf < < \" } , \" < < ' \\ n ' ; <nl> + <nl> str_buf < < \" \\ \" tree_info \\ \" : [ \" ; <nl> int num_used_model = static_cast < int > ( models_ . size ( ) ) ; <nl> int total_iteration = num_used_model / num_tree_per_iteration_ ; <nl> std : : string GBDT : : DumpModel ( int start_iteration , int num_iteration ) const { <nl> } <nl> } <nl> str_buf < < ' \\ n ' < < \" \\ \" feature_importances \\ \" : \" < < \" { \" ; <nl> - if ( ! pairs . empty ( ) ) { <nl> - str_buf < < \" \\ \" \" < < pairs [ 0 ] . second < < \" \\ \" : \" < < std : : to_string ( pairs [ 0 ] . first ) ; <nl> - for ( size_t i = 1 ; i < pairs . size ( ) ; + + i ) { <nl> + for ( size_t i = 0 ; i < pairs . size ( ) ; + + i ) { <nl> + if ( i > 0 ) { <nl> str_buf < < \" , \" ; <nl> - str_buf < < \" \\ \" \" < < pairs [ i ] . second < < \" \\ \" : \" < < std : : to_string ( pairs [ i ] . first ) ; <nl> } <nl> + str_buf < < \" \\ \" \" < < pairs [ i ] . second < < \" \\ \" : \" < < std : : to_string ( pairs [ i ] . first ) ; <nl> } <nl> str_buf < < \" } \" < < ' \\ n ' ; <nl> <nl>", "msg": "added feature infos to JSON dump ( )", "repo": "microsoft/LightGBM", "sha": "c4a7ab81702d0119de55d74f9d848f62435f3a1d", "time": "2020-02-20T05:51:05Z"}
{"diff": "mmm a / tensorflow / tools / compatibility / ast_edits . py <nl> ppp b / tensorflow / tools / compatibility / ast_edits . py <nl> class APIChangeSpec ( object ) : <nl> * ` function_warnings ` : maps full names of functions to warnings that will be <nl> printed out if the function is used . ( e . g . tf . nn . convolution ( ) ) <nl> * ` function_transformers ` : maps function names to custom handlers <nl> - * ` leftover_warnings ` : These warnings are printed if a matching Attribute <nl> - still exists after all other transformations have run . <nl> + * ` module_deprecations ` : maps module names to warnings that will be printed <nl> + if the module is still used after all other transformations have run <nl> <nl> For an example , see ` TFAPIChangeSpec ` . <nl> \" \" \" <nl> mmm a / tensorflow / tools / compatibility / tf_upgrade_v2 . py <nl> ppp b / tensorflow / tools / compatibility / tf_upgrade_v2 . py <nl> def __init__ ( self ) : <nl> \" the required code . \" <nl> ) <nl> <nl> + flags_warning = ( <nl> + ast_edits . ERROR , <nl> + \" tf . flags has been removed , please use the argparse or absl \" <nl> + \" modules if you need command line parsing . \" ) <nl> + <nl> decay_function_comment = ( <nl> ast_edits . INFO , <nl> \" To use learning rate decay schedules with TensorFlow 2 . 0 , switch to \" <nl> def __init__ ( self ) : <nl> assert_rank_comment , <nl> \" tf . debugging . assert_rank_in \" : <nl> assert_rank_comment , <nl> - \" tf . flags \" : ( <nl> - ast_edits . ERROR , <nl> - \" tf . flags has been removed , please use the argparse or absl \" <nl> - \" modules if you need command line parsing . \" ) , <nl> \" tf . train . exponential_decay \" : <nl> decay_function_comment , <nl> \" tf . train . piecewise_constant_decay \" : <nl> def __init__ ( self ) : <nl> <nl> self . module_deprecations = { <nl> \" tf . contrib \" : contrib_warning , <nl> + \" tf . flags \" : flags_warning , <nl> } <nl> <nl> <nl> mmm a / tensorflow / tools / compatibility / tf_upgrade_v2_test . py <nl> ppp b / tensorflow / tools / compatibility / tf_upgrade_v2_test . py <nl> def test_contrib_framework_argsort ( self ) : <nl> _ , _ , _ , new_text = self . _upgrade ( text ) <nl> self . assertEqual ( expected , new_text ) <nl> <nl> + def test_flags_bare ( self ) : <nl> + _ , _ , errors , _ = self . _upgrade ( \" tf . flags \" ) <nl> + self . assertIn ( \" tf . flags has been removed \" , errors [ 0 ] ) <nl> + <nl> + def test_flags_flags ( self ) : <nl> + _ , _ , errors , _ = self . _upgrade ( \" tf . flags . FLAGS \" ) <nl> + self . assertIn ( \" tf . flags has been removed \" , errors [ 0 ] ) <nl> + <nl> <nl> class TestUpgradeFiles ( test_util . TensorFlowTestCase ) : <nl> <nl>", "msg": "Make converter handle tf . flags as a module deprecation warning", "repo": "tensorflow/tensorflow", "sha": "f291fa19e7d9a3e73c7895a073a6acbf2dd7e15d", "time": "2019-02-01T20:14:25Z"}
{"diff": "mmm a / modules / gdscript / gdscript_parser . cpp <nl> ppp b / modules / gdscript / gdscript_parser . cpp <nl> void GDScriptParser : : _parse_class ( ClassNode * p_class ) { <nl> member . line = tokenizer - > get_token_line ( ) ; <nl> member . usages = 0 ; <nl> member . rpc_mode = rpc_mode ; <nl> - # ifdef TOOLS_ENABLED <nl> - Variant : : CallError ce ; <nl> - member . default_value = Variant : : construct ( member . _export . type , NULL , 0 , ce ) ; <nl> - # endif <nl> <nl> if ( current_class - > constant_expressions . has ( member . identifier ) ) { <nl> _set_error ( \" A constant named \\ \" \" + String ( member . identifier ) + \" \\ \" already exists in this class ( at line : \" + <nl> void GDScriptParser : : _parse_class ( ClassNode * p_class ) { <nl> } <nl> } <nl> <nl> + if ( autoexport & & member . data_type . has_type ) { <nl> + if ( member . data_type . kind = = DataType : : BUILTIN ) { <nl> + member . _export . type = member . data_type . builtin_type ; <nl> + } else if ( member . data_type . kind = = DataType : : NATIVE ) { <nl> + if ( ClassDB : : is_parent_class ( member . data_type . native_type , \" Resource \" ) ) { <nl> + member . _export . type = Variant : : OBJECT ; <nl> + member . _export . hint = PROPERTY_HINT_RESOURCE_TYPE ; <nl> + member . _export . usage | = PROPERTY_USAGE_SCRIPT_VARIABLE ; <nl> + member . _export . hint_string = member . data_type . native_type ; <nl> + member . _export . class_name = member . data_type . native_type ; <nl> + } else { <nl> + _set_error ( \" Invalid export type . Only built - in and native resource types can be exported . \" , member . line ) ; <nl> + return ; <nl> + } <nl> + <nl> + } else { <nl> + _set_error ( \" Invalid export type . Only built - in and native resource types can be exported . \" , member . line ) ; <nl> + return ; <nl> + } <nl> + } <nl> + <nl> + # ifdef TOOLS_ENABLED <nl> + Variant : : CallError ce ; <nl> + member . default_value = Variant : : construct ( member . _export . type , NULL , 0 , ce ) ; <nl> + # endif <nl> + <nl> if ( tokenizer - > get_token ( ) = = GDScriptTokenizer : : TK_OP_ASSIGN ) { <nl> <nl> # ifdef DEBUG_ENABLED <nl> void GDScriptParser : : _parse_class ( ClassNode * p_class ) { <nl> member . initial_assignment = op ; <nl> } <nl> <nl> - if ( autoexport & & member . data_type . has_type ) { <nl> - if ( member . data_type . kind = = DataType : : BUILTIN ) { <nl> - member . _export . type = member . data_type . builtin_type ; <nl> - } else if ( member . data_type . kind = = DataType : : NATIVE ) { <nl> - if ( ClassDB : : is_parent_class ( member . data_type . native_type , \" Resource \" ) ) { <nl> - member . _export . type = Variant : : OBJECT ; <nl> - member . _export . hint = PROPERTY_HINT_RESOURCE_TYPE ; <nl> - member . _export . usage | = PROPERTY_USAGE_SCRIPT_VARIABLE ; <nl> - member . _export . hint_string = member . data_type . native_type ; <nl> - member . _export . class_name = member . data_type . native_type ; <nl> - } else { <nl> - _set_error ( \" Invalid export type . Only built - in and native resource types can be exported . \" , member . line ) ; <nl> - return ; <nl> - } <nl> - <nl> - } else { <nl> - _set_error ( \" Invalid export type . Only built - in and native resource types can be exported . \" , member . line ) ; <nl> - return ; <nl> - } <nl> - } <nl> - <nl> if ( tokenizer - > get_token ( ) = = GDScriptTokenizer : : TK_PR_SETGET ) { <nl> <nl> tokenizer - > advance ( ) ; <nl>", "msg": "Merge pull request from bojidar - bg / 27575 - poolarrayexport - default", "repo": "godotengine/godot", "sha": "9986f3804caf32dc092ac7f094381745dc3ae8f8", "time": "2020-01-16T13:58:06Z"}
{"diff": "mmm a / torch / _torch_docs . py <nl> ppp b / torch / _torch_docs . py <nl> def merge_dicts ( * dicts ) : <nl> See : meth : ` ~ torch . svd ` for more details . <nl> <nl> Arguments : <nl> - input ( Tensor ) : The input 2D tensor of dimensions : math : ` m \\ times n ` <nl> + input ( Tensor ) : The input tensor of size : math : ` ( * , m , n ) ` where : math : ` * ` is zero or more batch dimensions <nl> rcond ( float ) : A floating point value to determine the cutoff for small singular values . <nl> Default : 1e - 15 <nl> <nl> Returns : <nl> - The pseudo - inverse of : attr : ` input ` of dimensions : math : ` n \\ times m ` <nl> + The pseudo - inverse of : attr : ` input ` of dimensions : math : ` ( * , n , m ) ` <nl> <nl> Example : : <nl> <nl> def merge_dicts ( * dicts ) : <nl> [ - 0 . 7124 , - 0 . 1631 , - 0 . 2272 ] , <nl> [ 0 . 1356 , 0 . 3933 , - 0 . 5023 ] , <nl> [ - 0 . 0308 , - 0 . 1725 , - 0 . 5216 ] ] ) <nl> + > > > # Batched pinverse example <nl> + > > > a = torch . randn ( 2 , 6 , 3 ) <nl> + > > > b = torch . pinverse ( a ) <nl> + > > > torch . matmul ( b , a ) <nl> + tensor ( [ [ [ 1 . 0000e + 00 , 1 . 6391e - 07 , - 1 . 1548e - 07 ] , <nl> + [ 8 . 3121e - 08 , 1 . 0000e + 00 , - 2 . 7567e - 07 ] , <nl> + [ 3 . 5390e - 08 , 1 . 4901e - 08 , 1 . 0000e + 00 ] ] , <nl> + <nl> + [ [ 1 . 0000e + 00 , - 8 . 9407e - 08 , 2 . 9802e - 08 ] , <nl> + [ - 2 . 2352e - 07 , 1 . 0000e + 00 , 1 . 1921e - 07 ] , <nl> + [ 0 . 0000e + 00 , 8 . 9407e - 08 , 1 . 0000e + 00 ] ] ] ) <nl> <nl> . . _Moore - Penrose inverse : https : / / en . wikipedia . org / wiki / Moore % E2 % 80 % 93Penrose_inverse <nl> <nl>", "msg": "Update pinverse doc for recent commit", "repo": "pytorch/pytorch", "sha": "1dcf1b8938fa0cf70373fb84a853c51517db46cc", "time": "2019-10-31T14:36:35Z"}
{"diff": "mmm a / Docker / Dockerfile <nl> ppp b / Docker / Dockerfile <nl> RUN git clone - b $ branch https : / / github . com / EOSIO / eos . git - - recursive \\ <nl> & & cd eos & & echo \" $ branch : $ ( git rev - parse HEAD ) \" > / etc / eosio - version \\ <nl> & & cmake - H . - B \" / tmp / build \" - GNinja - DCMAKE_BUILD_TYPE = Release - DWASM_ROOT = / opt / wasm - DCMAKE_CXX_COMPILER = clang + + \\ <nl> - DCMAKE_C_COMPILER = clang - DCMAKE_INSTALL_PREFIX = / tmp / build - DSecp256k1_ROOT_DIR = / usr / local - DBUILD_MONGO_DB_PLUGIN = true \\ <nl> - & & cmake - - build / tmp / build - - target install <nl> + & & cmake - - build / tmp / build - - target install & & rm / tmp / build / bin / eosiocpp <nl> <nl> <nl> FROM ubuntu : 18 . 04 <nl>", "msg": "remove eosiocpp from eosio / eos", "repo": "EOSIO/eos", "sha": "d3c78bc1e6bb3d7f4c114a4008bdb459656d88cf", "time": "2018-05-17T16:52:19Z"}
{"diff": "mmm a / include / gmock / gmock - matchers . h <nl> ppp b / include / gmock / gmock - matchers . h <nl> class GTEST_API_ Matcher < internal : : string > <nl> Matcher ( const char * s ) ; / / NOLINT <nl> } ; <nl> <nl> + # if GTEST_HAS_STRING_PIECE_ <nl> + / / The following two specializations allow the user to write str <nl> + / / instead of Eq ( str ) and \" foo \" instead of Eq ( \" foo \" ) when a StringPiece <nl> + / / matcher is expected . <nl> + template < > <nl> + class GTEST_API_ Matcher < const StringPiece & > <nl> + : public internal : : MatcherBase < const StringPiece & > { <nl> + public : <nl> + Matcher ( ) { } <nl> + <nl> + explicit Matcher ( const MatcherInterface < const StringPiece & > * impl ) <nl> + : internal : : MatcherBase < const StringPiece & > ( impl ) { } <nl> + <nl> + / / Allows the user to write str instead of Eq ( str ) sometimes , where <nl> + / / str is a string object . <nl> + Matcher ( const internal : : string & s ) ; / / NOLINT <nl> + <nl> + / / Allows the user to write \" foo \" instead of Eq ( \" foo \" ) sometimes . <nl> + Matcher ( const char * s ) ; / / NOLINT <nl> + <nl> + / / Allows the user to pass StringPieces directly . <nl> + Matcher ( StringPiece s ) ; / / NOLINT <nl> + } ; <nl> + <nl> + template < > <nl> + class GTEST_API_ Matcher < StringPiece > <nl> + : public internal : : MatcherBase < StringPiece > { <nl> + public : <nl> + Matcher ( ) { } <nl> + <nl> + explicit Matcher ( const MatcherInterface < StringPiece > * impl ) <nl> + : internal : : MatcherBase < StringPiece > ( impl ) { } <nl> + <nl> + / / Allows the user to write str instead of Eq ( str ) sometimes , where <nl> + / / str is a string object . <nl> + Matcher ( const internal : : string & s ) ; / / NOLINT <nl> + <nl> + / / Allows the user to write \" foo \" instead of Eq ( \" foo \" ) sometimes . <nl> + Matcher ( const char * s ) ; / / NOLINT <nl> + <nl> + / / Allows the user to pass StringPieces directly . <nl> + Matcher ( StringPiece s ) ; / / NOLINT <nl> + } ; <nl> + # endif / / GTEST_HAS_STRING_PIECE_ <nl> + <nl> / / The PolymorphicMatcher class template makes it easy to implement a <nl> / / polymorphic matcher ( i . e . a matcher that can match values of more <nl> / / than one type , e . g . Eq ( n ) and NotNull ( ) ) . <nl> mmm a / src / gmock - matchers . cc <nl> ppp b / src / gmock - matchers . cc <nl> Matcher < internal : : string > : : Matcher ( const char * s ) { <nl> * this = Eq ( internal : : string ( s ) ) ; <nl> } <nl> <nl> + # if GTEST_HAS_STRING_PIECE_ <nl> + / / Constructs a matcher that matches a const StringPiece & whose value is <nl> + / / equal to s . <nl> + Matcher < const StringPiece & > : : Matcher ( const internal : : string & s ) { <nl> + * this = Eq ( s ) ; <nl> + } <nl> + <nl> + / / Constructs a matcher that matches a const StringPiece & whose value is <nl> + / / equal to s . <nl> + Matcher < const StringPiece & > : : Matcher ( const char * s ) { <nl> + * this = Eq ( internal : : string ( s ) ) ; <nl> + } <nl> + <nl> + / / Constructs a matcher that matches a const StringPiece & whose value is <nl> + / / equal to s . <nl> + Matcher < const StringPiece & > : : Matcher ( StringPiece s ) { <nl> + * this = Eq ( s . ToString ( ) ) ; <nl> + } <nl> + <nl> + / / Constructs a matcher that matches a StringPiece whose value is equal to s . <nl> + Matcher < StringPiece > : : Matcher ( const internal : : string & s ) { <nl> + * this = Eq ( s ) ; <nl> + } <nl> + <nl> + / / Constructs a matcher that matches a StringPiece whose value is equal to s . <nl> + Matcher < StringPiece > : : Matcher ( const char * s ) { <nl> + * this = Eq ( internal : : string ( s ) ) ; <nl> + } <nl> + <nl> + / / Constructs a matcher that matches a StringPiece whose value is equal to s . <nl> + Matcher < StringPiece > : : Matcher ( StringPiece s ) { <nl> + * this = Eq ( s . ToString ( ) ) ; <nl> + } <nl> + # endif / / GTEST_HAS_STRING_PIECE_ <nl> + <nl> namespace internal { <nl> <nl> / / Joins a vector of strings as if they are fields of a tuple ; returns <nl> mmm a / test / gmock - matchers_test . cc <nl> ppp b / test / gmock - matchers_test . cc <nl> TEST ( StringMatcherTest , CanBeImplicitlyConstructedFromString ) { <nl> EXPECT_FALSE ( m2 . Matches ( \" hello \" ) ) ; <nl> } <nl> <nl> + # if GTEST_HAS_STRING_PIECE_ <nl> + / / Tests that a C - string literal can be implicitly converted to a <nl> + / / Matcher < StringPiece > or Matcher < const StringPiece & > . <nl> + TEST ( StringPieceMatcherTest , CanBeImplicitlyConstructedFromCStringLiteral ) { <nl> + Matcher < StringPiece > m1 = \" cats \" ; <nl> + EXPECT_TRUE ( m1 . Matches ( \" cats \" ) ) ; <nl> + EXPECT_FALSE ( m1 . Matches ( \" dogs \" ) ) ; <nl> + <nl> + Matcher < const StringPiece & > m2 = \" cats \" ; <nl> + EXPECT_TRUE ( m2 . Matches ( \" cats \" ) ) ; <nl> + EXPECT_FALSE ( m2 . Matches ( \" dogs \" ) ) ; <nl> + } <nl> + <nl> + / / Tests that a string object can be implicitly converted to a <nl> + / / Matcher < StringPiece > or Matcher < const StringPiece & > . <nl> + TEST ( StringPieceMatcherTest , CanBeImplicitlyConstructedFromString ) { <nl> + Matcher < StringPiece > m1 = string ( \" cats \" ) ; <nl> + EXPECT_TRUE ( m1 . Matches ( \" cats \" ) ) ; <nl> + EXPECT_FALSE ( m1 . Matches ( \" dogs \" ) ) ; <nl> + <nl> + Matcher < const StringPiece & > m2 = string ( \" cats \" ) ; <nl> + EXPECT_TRUE ( m2 . Matches ( \" cats \" ) ) ; <nl> + EXPECT_FALSE ( m2 . Matches ( \" dogs \" ) ) ; <nl> + } <nl> + <nl> + / / Tests that a StringPiece object can be implicitly converted to a <nl> + / / Matcher < StringPiece > or Matcher < const StringPiece & > . <nl> + TEST ( StringPieceMatcherTest , CanBeImplicitlyConstructedFromStringPiece ) { <nl> + Matcher < StringPiece > m1 = StringPiece ( \" cats \" ) ; <nl> + EXPECT_TRUE ( m1 . Matches ( \" cats \" ) ) ; <nl> + EXPECT_FALSE ( m1 . Matches ( \" dogs \" ) ) ; <nl> + <nl> + Matcher < const StringPiece & > m2 = StringPiece ( \" cats \" ) ; <nl> + EXPECT_TRUE ( m2 . Matches ( \" cats \" ) ) ; <nl> + EXPECT_FALSE ( m2 . Matches ( \" dogs \" ) ) ; <nl> + } <nl> + # endif / / GTEST_HAS_STRING_PIECE_ <nl> + <nl> / / Tests that MakeMatcher ( ) constructs a Matcher < T > from a <nl> / / MatcherInterface * without requiring the user to explicitly <nl> / / write the type . <nl>", "msg": "Adds special support for matching StringPiece . Pulls in gtest r646 .", "repo": "google/googletest", "sha": "1f122a06e6aad4d234123d2d8c1e352029ce0742", "time": "2013-03-25T16:27:03Z"}
{"diff": "mmm a / tensorflow / compiler / jit / xla_device_context . cc <nl> ppp b / tensorflow / compiler / jit / xla_device_context . cc <nl> void XlaDeviceAllocator : : DeallocateRaw ( void * ptr ) { <nl> delete XlaTensor : : FromOpaquePointer ( ptr ) ; <nl> } <nl> <nl> - AllocatorStats XlaDeviceAllocator : : GetStats ( ) { <nl> - stream_executor : : AllocatorStats se_stats = <nl> + absl : : optional < AllocatorStats > XlaDeviceAllocator : : GetStats ( ) { <nl> + absl : : optional < stream_executor : : AllocatorStats > se_stats = <nl> stream_executor_ - > GetAllocatorStats ( ) ; <nl> + if ( ! se_stats ) { <nl> + return absl : : nullopt ; <nl> + } <nl> <nl> tensorflow : : AllocatorStats tf_stats ; <nl> - tf_stats . num_allocs = se_stats . num_allocs ; <nl> - tf_stats . bytes_in_use = se_stats . bytes_in_use ; <nl> - tf_stats . peak_bytes_in_use = se_stats . peak_bytes_in_use ; <nl> - tf_stats . largest_alloc_size = se_stats . largest_alloc_size ; <nl> - tf_stats . bytes_limit = se_stats . bytes_limit ; <nl> + tf_stats . num_allocs = se_stats - > num_allocs ; <nl> + tf_stats . bytes_in_use = se_stats - > bytes_in_use ; <nl> + tf_stats . peak_bytes_in_use = se_stats - > peak_bytes_in_use ; <nl> + tf_stats . largest_alloc_size = se_stats - > largest_alloc_size ; <nl> + tf_stats . bytes_limit = se_stats - > bytes_limit ; <nl> return tf_stats ; <nl> } <nl> <nl> mmm a / tensorflow / compiler / jit / xla_device_context . h <nl> ppp b / tensorflow / compiler / jit / xla_device_context . h <nl> class XlaDeviceAllocator : public Allocator { <nl> <nl> void * AllocateRaw ( size_t alignment , size_t num_bytes ) override ; <nl> void DeallocateRaw ( void * ptr ) override ; <nl> - AllocatorStats GetStats ( ) override ; <nl> + absl : : optional < AllocatorStats > GetStats ( ) override ; <nl> <nl> private : <nl> / / The stream executor of the device . <nl> mmm a / tensorflow / contrib / memory_stats / kernels / memory_stats_ops . cc <nl> ppp b / tensorflow / contrib / memory_stats / kernels / memory_stats_ops . cc <nl> class MemoryStatsOp : public OpKernel { <nl> void Compute ( OpKernelContext * context ) override { <nl> Allocator * allocator = <nl> context - > device ( ) - > GetAllocator ( AllocatorAttributes ( ) ) ; <nl> - AllocatorStats allocator_stats = allocator - > GetStats ( ) ; <nl> + absl : : optional < AllocatorStats > allocator_stats = allocator - > GetStats ( ) ; <nl> + if ( ! allocator_stats ) { <nl> + * allocator_stats = AllocatorStats ( ) ; <nl> + } <nl> <nl> Tensor * output_tensor = nullptr ; <nl> OP_REQUIRES_OK ( <nl> context , context - > allocate_output ( 0 , TensorShape ( { } ) , & output_tensor ) ) ; <nl> - output_tensor - > scalar < int64 > ( ) ( ) = ExtractAllocatorStats ( allocator_stats ) ; <nl> + output_tensor - > scalar < int64 > ( ) ( ) = ExtractAllocatorStats ( * allocator_stats ) ; <nl> } <nl> <nl> protected : <nl> class BytesLimitOp : public MemoryStatsOp { <nl> private : <nl> int64 ExtractAllocatorStats ( <nl> const AllocatorStats & allocator_stats ) const override { <nl> - return allocator_stats . bytes_limit ; <nl> + return allocator_stats . bytes_limit ? * allocator_stats . bytes_limit : - 1 ; <nl> } <nl> } ; <nl> <nl> mmm a / tensorflow / core / common_runtime / bfc_allocator . cc <nl> ppp b / tensorflow / core / common_runtime / bfc_allocator . cc <nl> void BFCAllocator : : DumpMemoryLog ( size_t num_bytes ) { <nl> LOG ( INFO ) < < \" Stats : \\ n \" < < stats_ . DebugString ( ) ; <nl> } <nl> <nl> - AllocatorStats BFCAllocator : : GetStats ( ) { <nl> + absl : : optional < AllocatorStats > BFCAllocator : : GetStats ( ) { <nl> mutex_lock l ( lock_ ) ; <nl> return stats_ ; <nl> } <nl> mmm a / tensorflow / core / common_runtime / bfc_allocator . h <nl> ppp b / tensorflow / core / common_runtime / bfc_allocator . h <nl> class BFCAllocator : public Allocator { <nl> <nl> int64 AllocationId ( const void * ptr ) override ; <nl> <nl> - AllocatorStats GetStats ( ) override ; <nl> + absl : : optional < AllocatorStats > GetStats ( ) override ; <nl> <nl> void ClearStats ( ) override ; <nl> <nl> mmm a / tensorflow / core / common_runtime / eager / kernel_and_device . cc <nl> ppp b / tensorflow / core / common_runtime / eager / kernel_and_device . cc <nl> void UpdateStats ( OpKernelContext * context , <nl> memory - > set_peak_bytes ( std : : get < 1 > ( sizes ) ) ; <nl> memory - > set_live_bytes ( std : : get < 2 > ( sizes ) ) ; <nl> <nl> - AllocatorStats allocator_stats = allocator_pair . first - > GetStats ( ) ; <nl> - memory - > set_allocator_bytes_in_use ( allocator_stats . bytes_in_use ) ; <nl> + absl : : optional < AllocatorStats > allocator_stats = <nl> + allocator_pair . first - > GetStats ( ) ; <nl> + if ( stats ) { <nl> + memory - > set_allocator_bytes_in_use ( allocator_stats - > bytes_in_use ) ; <nl> + } <nl> allocator_pair . second - > GetRecordsAndUnRef ( ) ; <nl> } <nl> auto * ms = stats - > mutable_memory_stats ( ) ; <nl> mmm a / tensorflow / core / common_runtime / gpu / gpu_bfc_allocator_test . cc <nl> ppp b / tensorflow / core / common_runtime / gpu / gpu_bfc_allocator_test . cc <nl> namespace { <nl> <nl> static void CheckStats ( Allocator * a , int64 num_allocs , int64 bytes_in_use , <nl> int64 peak_bytes_in_use , int64 largest_alloc_size ) { <nl> - AllocatorStats stats = a - > GetStats ( ) ; <nl> - LOG ( INFO ) < < \" Alloc stats : \" < < std : : endl < < stats . DebugString ( ) ; <nl> - EXPECT_EQ ( stats . bytes_in_use , bytes_in_use ) ; <nl> - EXPECT_EQ ( stats . peak_bytes_in_use , peak_bytes_in_use ) ; <nl> - EXPECT_EQ ( stats . num_allocs , num_allocs ) ; <nl> - EXPECT_EQ ( stats . largest_alloc_size , largest_alloc_size ) ; <nl> + absl : : optional < AllocatorStats > stats = a - > GetStats ( ) ; <nl> + EXPECT_TRUE ( stats ) ; <nl> + if ( ! stats ) { <nl> + return ; <nl> + } <nl> + LOG ( INFO ) < < \" Alloc stats : \" < < std : : endl < < stats - > DebugString ( ) ; <nl> + EXPECT_EQ ( stats - > bytes_in_use , bytes_in_use ) ; <nl> + EXPECT_EQ ( stats - > peak_bytes_in_use , peak_bytes_in_use ) ; <nl> + EXPECT_EQ ( stats - > num_allocs , num_allocs ) ; <nl> + EXPECT_EQ ( stats - > largest_alloc_size , largest_alloc_size ) ; <nl> } <nl> <nl> TEST ( GPUBFCAllocatorTest , NoDups ) { <nl> TEST ( GPUBFCAllocatorTest , AllocationsAndDeallocationsWithGrowth ) { <nl> a . DeallocateRaw ( existing_ptrs [ i ] ) ; <nl> } <nl> <nl> - AllocatorStats stats = a . GetStats ( ) ; <nl> - LOG ( INFO ) < < \" Alloc stats : \\ n \" < < stats . DebugString ( ) ; <nl> + absl : : optional < AllocatorStats > stats = a . GetStats ( ) ; <nl> + if ( stats ) { <nl> + LOG ( INFO ) < < \" Alloc stats : \\ n \" < < stats - > DebugString ( ) ; <nl> + } <nl> } <nl> <nl> TEST ( GPUBFCAllocatorTest , DISABLED_AllocatorReceivesZeroMemory ) { <nl> mmm a / tensorflow / core / common_runtime / gpu / gpu_debug_allocator . cc <nl> ppp b / tensorflow / core / common_runtime / gpu / gpu_debug_allocator . cc <nl> int64 GPUDebugAllocator : : AllocationId ( const void * ptr ) { <nl> MASK_BYTES ) ; <nl> } <nl> <nl> - AllocatorStats GPUDebugAllocator : : GetStats ( ) { <nl> + absl : : optional < AllocatorStats > GPUDebugAllocator : : GetStats ( ) { <nl> return base_allocator_ - > GetStats ( ) ; <nl> } <nl> <nl> size_t GPUNanResetAllocator : : AllocatedSize ( const void * ptr ) { <nl> return base_allocator_ - > AllocatedSize ( ptr ) ; <nl> } <nl> <nl> - AllocatorStats GPUNanResetAllocator : : GetStats ( ) { <nl> + absl : : optional < AllocatorStats > GPUNanResetAllocator : : GetStats ( ) { <nl> return base_allocator_ - > GetStats ( ) ; <nl> } <nl> <nl> mmm a / tensorflow / core / common_runtime / gpu / gpu_debug_allocator . h <nl> ppp b / tensorflow / core / common_runtime / gpu / gpu_debug_allocator . h <nl> class GPUDebugAllocator : public Allocator { <nl> size_t RequestedSize ( const void * ptr ) override ; <nl> size_t AllocatedSize ( const void * ptr ) override ; <nl> int64 AllocationId ( const void * ptr ) override ; <nl> - AllocatorStats GetStats ( ) override ; <nl> + absl : : optional < AllocatorStats > GetStats ( ) override ; <nl> void ClearStats ( ) override ; <nl> <nl> / / For testing . <nl> class GPUNanResetAllocator : public Allocator { <nl> void DeallocateRaw ( void * ptr ) override ; <nl> size_t RequestedSize ( const void * ptr ) override ; <nl> size_t AllocatedSize ( const void * ptr ) override ; <nl> - AllocatorStats GetStats ( ) override ; <nl> + absl : : optional < AllocatorStats > GetStats ( ) override ; <nl> void ClearStats ( ) override ; <nl> <nl> private : <nl> mmm a / tensorflow / core / common_runtime / gpu / gpu_device . cc <nl> ppp b / tensorflow / core / common_runtime / gpu / gpu_device . cc <nl> Status BaseGPUDeviceFactory : : CreateGPUDevice ( <nl> tf_gpu_id . value ( ) , \" with \" , memory_limit , <nl> \" bytes of memory . \" ) ; <nl> } <nl> - AllocatorStats stats = gpu_allocator - > GetStats ( ) ; <nl> + absl : : optional < AllocatorStats > stats = gpu_allocator - > GetStats ( ) ; <nl> + if ( ! stats ) { <nl> + return errors : : Internal ( \" No allocator statistics \" ) ; <nl> + } <nl> / / ' memory_limit ' is the required memory size , but if the allocator with given <nl> / / tf_gpu_id was created before , we ' ll use it instead of creating a new one <nl> / / ( as TF gpu device is a shared resource ) , in which case the actual memory <nl> Status BaseGPUDeviceFactory : : CreateGPUDevice ( <nl> / / different ( which should be an error ) . <nl> / / <nl> / / TODO ( laigd ) : report error if memory_limit doesn ' t match stats - > bytes_limit . <nl> - int64 bytes_limit = stats . bytes_limit ; <nl> + int64 bytes_limit = stats - > bytes_limit ? * stats - > bytes_limit : 0 ; <nl> std : : unique_ptr < BaseGPUDevice > gpu_device = CreateGPUDevice ( <nl> options , device_name , static_cast < Bytes > ( bytes_limit ) , dev_locality , <nl> tf_gpu_id , GetShortDeviceDescription ( platform_gpu_id , desc ) , <nl> mmm a / tensorflow / core / common_runtime / process_state . h <nl> ppp b / tensorflow / core / common_runtime / process_state . h <nl> class RecordingAllocator : public Allocator { <nl> bool TracksAllocationSizes ( ) override { return a_ - > TracksAllocationSizes ( ) ; } <nl> size_t RequestedSize ( const void * p ) override { return a_ - > RequestedSize ( p ) ; } <nl> size_t AllocatedSize ( const void * p ) override { return a_ - > AllocatedSize ( p ) ; } <nl> - AllocatorStats GetStats ( ) override { return a_ - > GetStats ( ) ; } <nl> + absl : : optional < AllocatorStats > GetStats ( ) override { return a_ - > GetStats ( ) ; } <nl> void ClearStats ( ) override { a_ - > ClearStats ( ) ; } <nl> ProcessState : : MDMap * mm_ ; / / not owned <nl> Allocator * a_ ; / / not owned <nl> mmm a / tensorflow / core / common_runtime / step_stats_collector . cc <nl> ppp b / tensorflow / core / common_runtime / step_stats_collector . cc <nl> void NodeExecStatsWrapper : : AddAllocation ( <nl> memory - > set_peak_bytes ( std : : get < 1 > ( sizes ) ) ; <nl> memory - > set_live_bytes ( std : : get < 2 > ( sizes ) ) ; <nl> <nl> - AllocatorStats stats = allocator - > GetStats ( ) ; <nl> - memory - > set_allocator_bytes_in_use ( stats . bytes_in_use ) ; <nl> + absl : : optional < AllocatorStats > stats = allocator - > GetStats ( ) ; <nl> + if ( stats ) { <nl> + memory - > set_allocator_bytes_in_use ( stats - > bytes_in_use ) ; <nl> + } <nl> allocations_ . push_back ( std : : make_pair ( memory , tracking_allocator ) ) ; <nl> } <nl> <nl> mmm a / tensorflow / core / framework / allocator . cc <nl> ppp b / tensorflow / core / framework / allocator . cc <nl> string AllocatorStats : : DebugString ( ) const { <nl> \" MaxInUse : % 20lld \\ n \" <nl> \" NumAllocs : % 20lld \\ n \" <nl> \" MaxAllocSize : % 20lld \\ n \" , <nl> - this - > bytes_limit , this - > bytes_in_use , this - > peak_bytes_in_use , <nl> - this - > num_allocs , this - > largest_alloc_size ) ; <nl> + this - > bytes_limit ? * this - > bytes_limit : 0 , this - > bytes_in_use , <nl> + this - > peak_bytes_in_use , this - > num_allocs , this - > largest_alloc_size ) ; <nl> } <nl> <nl> constexpr size_t Allocator : : kAllocatorAlignment ; <nl> class CPUAllocator : public Allocator { <nl> port : : AlignedFree ( ptr ) ; <nl> } <nl> <nl> - AllocatorStats GetStats ( ) override { <nl> + absl : : optional < AllocatorStats > GetStats ( ) override { <nl> mutex_lock l ( mu_ ) ; <nl> return stats_ ; <nl> } <nl> mmm a / tensorflow / core / framework / allocator . h <nl> ppp b / tensorflow / core / framework / allocator . h <nl> limitations under the License . <nl> <nl> # include < limits > <nl> <nl> + # include \" absl / strings / string_view . h \" <nl> + # include \" absl / types / optional . h \" <nl> # include \" tensorflow / core / framework / numeric_types . h \" <nl> # include \" tensorflow / core / framework / resource_handle . h \" <nl> # include \" tensorflow / core / framework / type_traits . h \" <nl> struct AllocatorStats { <nl> int64 largest_alloc_size ; / / The largest single allocation seen . <nl> <nl> / / The upper limit of bytes of user allocatable device memory , if such a limit <nl> - / / is known . Certain allocators may return 0 to indicate the limit is unknown . <nl> - int64 bytes_limit ; <nl> + / / is known . <nl> + absl : : optional < int64 > bytes_limit ; <nl> <nl> AllocatorStats ( ) <nl> : num_allocs ( 0 ) , <nl> bytes_in_use ( 0 ) , <nl> peak_bytes_in_use ( 0 ) , <nl> - largest_alloc_size ( 0 ) , <nl> - bytes_limit ( 0 ) { } <nl> + largest_alloc_size ( 0 ) { } <nl> <nl> string DebugString ( ) const ; <nl> } ; <nl> class Allocator { <nl> } <nl> <nl> / / Fills in ' stats ' with statistics collected by this allocator . <nl> - virtual AllocatorStats GetStats ( ) { return AllocatorStats ( ) ; } <nl> + virtual absl : : optional < AllocatorStats > GetStats ( ) { return absl : : nullopt ; } <nl> <nl> / / Clears the internal stats except for the ` in_use ` field . <nl> virtual void ClearStats ( ) { } <nl> mmm a / tensorflow / core / framework / allocator_test . cc <nl> ppp b / tensorflow / core / framework / allocator_test . cc <nl> namespace tensorflow { <nl> <nl> static void CheckStats ( Allocator * a , int64 num_allocs , int64 bytes_in_use , <nl> int64 peak_bytes_in_use , int64 largest_alloc_size ) { <nl> - AllocatorStats stats = a - > GetStats ( ) ; <nl> - LOG ( INFO ) < < \" Alloc stats : \\ n \" < < stats . DebugString ( ) ; <nl> + absl : : optional < AllocatorStats > stats = a - > GetStats ( ) ; <nl> + EXPECT_TRUE ( stats ) ; <nl> + if ( ! stats ) { <nl> + return ; <nl> + } <nl> + LOG ( INFO ) < < \" Alloc stats : \\ n \" < < stats - > DebugString ( ) ; <nl> # if defined ( PLATFORM_GOOGLE ) & & defined ( NDEBUG ) <nl> / / NOTE : allocator stats expectation depends on the system malloc , <nl> / / and can vary as that changes . <nl> static const int64 kSlop = 5 * 1024 ; <nl> - EXPECT_GT ( stats . bytes_in_use , bytes_in_use - kSlop ) ; <nl> - EXPECT_LT ( stats . bytes_in_use , bytes_in_use + kSlop ) ; <nl> - EXPECT_GT ( stats . peak_bytes_in_use , peak_bytes_in_use - kSlop ) ; <nl> - EXPECT_LT ( stats . peak_bytes_in_use , peak_bytes_in_use + kSlop ) ; <nl> - EXPECT_EQ ( stats . num_allocs , num_allocs ) ; <nl> - EXPECT_EQ ( stats . largest_alloc_size , largest_alloc_size ) ; <nl> + EXPECT_GT ( stats - > bytes_in_use , bytes_in_use - kSlop ) ; <nl> + EXPECT_LT ( stats - > bytes_in_use , bytes_in_use + kSlop ) ; <nl> + EXPECT_GT ( stats - > peak_bytes_in_use , peak_bytes_in_use - kSlop ) ; <nl> + EXPECT_LT ( stats - > peak_bytes_in_use , peak_bytes_in_use + kSlop ) ; <nl> + EXPECT_EQ ( stats - > num_allocs , num_allocs ) ; <nl> + EXPECT_EQ ( stats - > largest_alloc_size , largest_alloc_size ) ; <nl> # endif <nl> } <nl> <nl> mmm a / tensorflow / core / framework / tracking_allocator . cc <nl> ppp b / tensorflow / core / framework / tracking_allocator . cc <nl> int64 TrackingAllocator : : AllocationId ( const void * ptr ) { <nl> } <nl> } <nl> <nl> - AllocatorStats TrackingAllocator : : GetStats ( ) { return allocator_ - > GetStats ( ) ; } <nl> + absl : : optional < AllocatorStats > TrackingAllocator : : GetStats ( ) { <nl> + return allocator_ - > GetStats ( ) ; <nl> + } <nl> <nl> void TrackingAllocator : : ClearStats ( ) { allocator_ - > ClearStats ( ) ; } <nl> <nl> mmm a / tensorflow / core / framework / tracking_allocator . h <nl> ppp b / tensorflow / core / framework / tracking_allocator . h <nl> class TrackingAllocator : public Allocator { <nl> size_t RequestedSize ( const void * ptr ) override ; <nl> size_t AllocatedSize ( const void * ptr ) override ; <nl> int64 AllocationId ( const void * ptr ) override ; <nl> - AllocatorStats GetStats ( ) override ; <nl> + absl : : optional < AllocatorStats > GetStats ( ) override ; <nl> void ClearStats ( ) override ; <nl> <nl> / / If the underlying allocator tracks allocation sizes , this returns <nl> mmm a / tensorflow / core / framework / tracking_allocator_test . cc <nl> ppp b / tensorflow / core / framework / tracking_allocator_test . cc <nl> class TestableSizeTrackingAllocator : public Allocator { <nl> EXPECT_NE ( size_map_ . end ( ) , iter ) ; <nl> return iter - > second ; <nl> } <nl> + absl : : optional < AllocatorStats > GetStats ( ) override { return absl : : nullopt ; } <nl> <nl> private : <nl> std : : unordered_map < const void * , size_t > size_map_ ; <nl> class NoMemoryAllocator : public Allocator { <nl> } <nl> void DeallocateRaw ( void * ptr ) override { } <nl> bool TracksAllocationSizes ( ) override { return true ; } <nl> + absl : : optional < AllocatorStats > GetStats ( ) override { return absl : : nullopt ; } <nl> } ; <nl> <nl> TEST ( TrackingAllocatorTest , SimpleNoTracking ) { <nl> mmm a / tensorflow / core / grappler / clusters / single_machine . cc <nl> ppp b / tensorflow / core / grappler / clusters / single_machine . cc <nl> Status SingleMachine : : GetPeakMemoryUsage ( <nl> return Status ( error : : INVALID_ARGUMENT , <nl> \" Tracking allocation is not enabled . \" ) ; <nl> } <nl> - AllocatorStats stats = allocator - > GetStats ( ) ; <nl> - ( * device_peak_memory ) [ device - > name ( ) ] = stats . peak_bytes_in_use ; <nl> + absl : : optional < AllocatorStats > stats = allocator - > GetStats ( ) ; <nl> + ( * device_peak_memory ) [ device - > name ( ) ] = <nl> + ( stats ? stats - > peak_bytes_in_use : 0 ) ; <nl> } <nl> <nl> return Status : : OK ( ) ; <nl> mmm a / tensorflow / core / kernels / stack . cc <nl> ppp b / tensorflow / core / kernels / stack . cc <nl> void StackPushOp : : ComputeAsync ( OpKernelContext * ctx , DoneCallback done ) { <nl> DeviceContext * device_ctxt = ctx - > op_device_context ( ) ; <nl> auto device = static_cast < tensorflow : : Device * > ( ctx - > device ( ) ) ; <nl> Allocator * allocator = device - > GetAllocator ( alloc_attrs ) ; <nl> - AllocatorStats stats = allocator - > GetStats ( ) ; <nl> - if ( stats . bytes_limit & & <nl> - stats . bytes_in_use > ( stats . bytes_limit * kOccupancy ) ) { <nl> + absl : : optional < AllocatorStats > stats = allocator - > GetStats ( ) ; <nl> + if ( stats & & * stats - > bytes_limit & & <nl> + stats - > bytes_in_use > ( * stats - > bytes_limit * kOccupancy ) ) { <nl> / / Asynchronously copy the tensor from GPU to CPU memory . <nl> / / TODO ( yuanbyu ) : Swap the oldest tensor first . <nl> AllocatorAttributes host_alloc_attrs ; <nl> mmm a / tensorflow / stream_executor / BUILD <nl> ppp b / tensorflow / stream_executor / BUILD <nl> cc_library ( <nl> \" / / tensorflow / core : lib \" , <nl> \" / / tensorflow / stream_executor / lib \" , <nl> \" / / tensorflow / stream_executor / platform \" , <nl> + \" @ com_google_absl / / absl / base : core_headers \" , <nl> \" @ com_google_absl / / absl / types : optional \" , <nl> \" @ com_google_absl / / absl / types : span \" , <nl> ] , <nl> cc_library ( <nl> \" / / tensorflow / stream_executor / platform \" , <nl> \" @ com_google_absl / / absl / base : core_headers \" , <nl> \" @ com_google_absl / / absl / strings \" , <nl> + \" @ com_google_absl / / absl / types : optional \" , <nl> ] , <nl> ) <nl> <nl> cc_library ( <nl> deps = [ <nl> \" / / tensorflow / stream_executor / platform \" , <nl> \" @ com_google_absl / / absl / strings : str_format \" , <nl> + \" @ com_google_absl / / absl / types : optional \" , <nl> ] , <nl> ) <nl> <nl> mmm a / tensorflow / stream_executor / allocator_stats . cc <nl> ppp b / tensorflow / stream_executor / allocator_stats . cc <nl> string AllocatorStats : : DebugString ( ) const { <nl> \" MaxInUse : % 20lld \\ n \" <nl> \" NumAllocs : % 20lld \\ n \" <nl> \" MaxAllocSize : % 20lld \\ n \" , <nl> - this - > bytes_limit , this - > bytes_in_use , this - > peak_bytes_in_use , <nl> - this - > num_allocs , this - > largest_alloc_size ) ; <nl> + this - > bytes_limit ? * this - > bytes_limit : 0 , this - > bytes_in_use , <nl> + this - > peak_bytes_in_use , this - > num_allocs , this - > largest_alloc_size ) ; <nl> } <nl> <nl> } / / namespace stream_executor <nl> mmm a / tensorflow / stream_executor / allocator_stats . h <nl> ppp b / tensorflow / stream_executor / allocator_stats . h <nl> limitations under the License . <nl> <nl> # include < string > <nl> <nl> + # include \" absl / types / optional . h \" <nl> # include \" tensorflow / stream_executor / platform / port . h \" <nl> <nl> namespace stream_executor { <nl> struct AllocatorStats { <nl> int64 largest_alloc_size ; / / The largest single allocation seen . <nl> <nl> / / The upper limit of bytes of user allocatable device memory , if such a limit <nl> - / / is known . Certain allocators may return 0 to indicate the limit is unknown . <nl> - int64 bytes_limit ; <nl> + / / is known . <nl> + absl : : optional < int64 > bytes_limit ; <nl> <nl> AllocatorStats ( ) <nl> : num_allocs ( 0 ) , <nl> bytes_in_use ( 0 ) , <nl> peak_bytes_in_use ( 0 ) , <nl> - largest_alloc_size ( 0 ) , <nl> - bytes_limit ( 0 ) { } <nl> + largest_alloc_size ( 0 ) { } <nl> <nl> string DebugString ( ) const ; <nl> } ; <nl> mmm a / tensorflow / stream_executor / stream_executor_internal . h <nl> ppp b / tensorflow / stream_executor / stream_executor_internal . h <nl> class StreamExecutorInterface { <nl> virtual void * GpuContextHack ( ) { return nullptr ; } <nl> <nl> / / Return allocator statistics . <nl> - virtual AllocatorStats GetAllocatorStats ( ) { return AllocatorStats ( ) ; } <nl> + virtual absl : : optional < AllocatorStats > GetAllocatorStats ( ) { <nl> + return absl : : nullopt ; <nl> + } <nl> <nl> private : <nl> SE_DISALLOW_COPY_AND_ASSIGN ( StreamExecutorInterface ) ; <nl> mmm a / tensorflow / stream_executor / stream_executor_pimpl . cc <nl> ppp b / tensorflow / stream_executor / stream_executor_pimpl . cc <nl> bool StreamExecutor : : UnregisterTraceListener ( TraceListener * listener ) { <nl> return true ; <nl> } <nl> <nl> - AllocatorStats StreamExecutor : : GetAllocatorStats ( ) { <nl> + absl : : optional < AllocatorStats > StreamExecutor : : GetAllocatorStats ( ) { <nl> return implementation_ - > GetAllocatorStats ( ) ; <nl> } <nl> <nl> mmm a / tensorflow / stream_executor / stream_executor_pimpl . h <nl> ppp b / tensorflow / stream_executor / stream_executor_pimpl . h <nl> limitations under the License . <nl> # include < vector > <nl> <nl> # include \" absl / base / macros . h \" <nl> + # include \" absl / types / optional . h \" <nl> # include \" tensorflow / stream_executor / lib / status . h \" <nl> # include \" tensorflow / stream_executor / lib / statusor . h \" <nl> # include \" tensorflow / stream_executor / lib / threadpool . h \" <nl> class StreamExecutor { <nl> bool UnregisterTraceListener ( TraceListener * listener ) ; <nl> <nl> / / Return allocator statistics . <nl> - AllocatorStats GetAllocatorStats ( ) ; <nl> + absl : : optional < AllocatorStats > GetAllocatorStats ( ) ; <nl> <nl> private : <nl> template < typename BeginCallT , typename CompleteCallT , <nl>", "msg": "Automated rollback of commit 9ca8321d68b74ce4f30756366919c80282ca2b68", "repo": "tensorflow/tensorflow", "sha": "d10b88cd4a487624221d5960657bc15cf8a0e2d3", "time": "2019-02-24T22:58:49Z"}
{"diff": "mmm a / cocos / platform / android / jni / JniHelper . cpp <nl> ppp b / cocos / platform / android / jni / JniHelper . cpp <nl> THE SOFTWARE . <nl> <nl> # define LOG_TAG \" JniHelper \" <nl> # define LOGD ( . . . ) __android_log_print ( ANDROID_LOG_DEBUG , LOG_TAG , __VA_ARGS__ ) <nl> + # define LOGE ( . . . ) __android_log_print ( ANDROID_LOG_ERROR , LOG_TAG , __VA_ARGS__ ) <nl> <nl> static pthread_key_t g_key ; <nl> <nl> jclass _getClassID ( const char * className ) { <nl> _jstrClassName ) ; <nl> <nl> if ( NULL = = _clazz ) { <nl> - LOGD ( \" Classloader failed to find class of % s \" , className ) ; <nl> + LOGE ( \" Classloader failed to find class of % s \" , className ) ; <nl> + env - > ExceptionClear ( ) ; <nl> } <nl> <nl> env - > DeleteLocalRef ( _jstrClassName ) ; <nl> namespace cocos2d { <nl> <nl> if ( jvm - > AttachCurrentThread ( & _env , NULL ) < 0 ) <nl> { <nl> - LOGD ( \" Failed to get the environment using AttachCurrentThread ( ) \" ) ; <nl> + LOGE ( \" Failed to get the environment using AttachCurrentThread ( ) \" ) ; <nl> <nl> return NULL ; <nl> } else { <nl> namespace cocos2d { <nl> <nl> case JNI_EVERSION : <nl> / / Cannot recover from this error <nl> - LOGD ( \" JNI interface version 1 . 4 not supported \" ) ; <nl> + LOGE ( \" JNI interface version 1 . 4 not supported \" ) ; <nl> default : <nl> - LOGD ( \" Failed to get the environment using GetEnv ( ) \" ) ; <nl> + LOGE ( \" Failed to get the environment using GetEnv ( ) \" ) ; <nl> return NULL ; <nl> } <nl> } <nl> namespace cocos2d { <nl> <nl> JNIEnv * pEnv = JniHelper : : getEnv ( ) ; <nl> if ( ! pEnv ) { <nl> - LOGD ( \" Failed to get JNIEnv \" ) ; <nl> + LOGE ( \" Failed to get JNIEnv \" ) ; <nl> return false ; <nl> } <nl> <nl> jclass classID = _getClassID ( className ) ; <nl> if ( ! classID ) { <nl> - LOGD ( \" Failed to find class % s \" , className ) ; <nl> + LOGE ( \" Failed to find class % s \" , className ) ; <nl> + pEnv - > ExceptionClear ( ) ; <nl> return false ; <nl> } <nl> <nl> jmethodID methodID = pEnv - > GetStaticMethodID ( classID , methodName , paramCode ) ; <nl> if ( ! methodID ) { <nl> - LOGD ( \" Failed to find static method id of % s \" , methodName ) ; <nl> + LOGE ( \" Failed to find static method id of % s \" , methodName ) ; <nl> + pEnv - > ExceptionClear ( ) ; <nl> return false ; <nl> } <nl> <nl> namespace cocos2d { <nl> <nl> jclass classID = pEnv - > FindClass ( className ) ; <nl> if ( ! classID ) { <nl> - LOGD ( \" Failed to find class % s \" , className ) ; <nl> + LOGE ( \" Failed to find class % s \" , className ) ; <nl> + pEnv - > ExceptionClear ( ) ; <nl> return false ; <nl> } <nl> <nl> jmethodID methodID = pEnv - > GetMethodID ( classID , methodName , paramCode ) ; <nl> if ( ! methodID ) { <nl> - LOGD ( \" Failed to find method id of % s \" , methodName ) ; <nl> + LOGE ( \" Failed to find method id of % s \" , methodName ) ; <nl> + pEnv - > ExceptionClear ( ) ; <nl> return false ; <nl> } <nl> <nl> namespace cocos2d { <nl> <nl> jclass classID = _getClassID ( className ) ; <nl> if ( ! classID ) { <nl> - LOGD ( \" Failed to find class % s \" , className ) ; <nl> + LOGE ( \" Failed to find class % s \" , className ) ; <nl> pEnv - > ExceptionClear ( ) ; <nl> return false ; <nl> } <nl> <nl> jmethodID methodID = pEnv - > GetMethodID ( classID , methodName , paramCode ) ; <nl> if ( ! methodID ) { <nl> - LOGD ( \" Failed to find method id of % s \" , methodName ) ; <nl> + LOGE ( \" Failed to find method id of % s \" , methodName ) ; <nl> pEnv - > ExceptionClear ( ) ; <nl> return false ; <nl> } <nl>", "msg": "android uni error clear & more readable log", "repo": "cocos2d/cocos2d-x", "sha": "cd892abc7781e1c46fabaf1c19528b1a4e3b647b", "time": "2014-05-20T10:52:21Z"}