fix SWIG warning 503 for operator ==

This commit is contained in:
Zhou Wang 2017-05-12 14:58:36 +02:00
Родитель 6866c4cac5
Коммит e2f07b9c55
3 изменённых файлов: 28 добавлений и 20 удалений

Просмотреть файл

@ -287,6 +287,7 @@ SWIG_STD_VECTOR_ENHANCED(CNTK::DeviceDescriptor)
%ignore_function CNTK::CreateEvaluator; %ignore_function CNTK::CreateEvaluator;
%ignore_struct CNTK::StreamInformation; %ignore_struct CNTK::StreamInformation;
%ignore_struct std::hash<::CNTK::StreamInformation>; %ignore_struct std::hash<::CNTK::StreamInformation>;
%ignore operator==(const StreamInformation& left, const StreamInformation& right);
%ignore_struct CNTK::MinibatchData; %ignore_struct CNTK::MinibatchData;
%ignore_class CNTK::MinibatchSource; %ignore_class CNTK::MinibatchSource;
@ -299,6 +300,7 @@ SWIG_STD_VECTOR_ENHANCED(CNTK::DeviceDescriptor)
%ignore_function CNTK::TextFormatMinibatchSource; %ignore_function CNTK::TextFormatMinibatchSource;
%ignore_function CNTK::ComputeInputPerDimMeansAndInvStdDevs; %ignore_function CNTK::ComputeInputPerDimMeansAndInvStdDevs;
%ignore_struct CNTK::DistributedWorkerDescriptor; %ignore_struct CNTK::DistributedWorkerDescriptor;
%ignore operator==(const DistributedWorkerDescriptor& left, const DistributedWorkerDescriptor& right);
%ignore_class CNTK::DistributedCommunicator; %ignore_class CNTK::DistributedCommunicator;
%ignore_class CNTK::QuantizedDistributedCommunicator; %ignore_class CNTK::QuantizedDistributedCommunicator;
%ignore_function CNTK::MPICommunicator; %ignore_function CNTK::MPICommunicator;
@ -398,12 +400,12 @@ SWIG_STD_VECTOR_ENHANCED(CNTK::DeviceDescriptor)
%rename (GetDeviceType) CNTK::DeviceDescriptor::Type; %rename (GetDeviceType) CNTK::DeviceDescriptor::Type;
%rename (GetId) CNTK::DeviceDescriptor::Id; %rename (GetId) CNTK::DeviceDescriptor::Id;
%rename (_SetExcludedDevices) CNTK::DeviceDescriptor::SetExcludedDevices; %rename (_SetExcludedDevices) CNTK::DeviceDescriptor::SetExcludedDevices;
%rename (AreEqualDeviceDescriptor) CNTK::operator==(const DeviceDescriptor& left, const DeviceDescriptor& right); // %rename (AreEqualDeviceDescriptor) CNTK::operator==(const DeviceDescriptor& left, const DeviceDescriptor& right);
// class Axis // class Axis
%rename (GetName) CNTK::Axis::Name; %rename (GetName) CNTK::Axis::Name;
%rename (IsOrderedAxis) CNTK::Axis::IsOrdered; %rename (IsOrderedAxis) CNTK::Axis::IsOrdered;
%rename (AreEqualAxis) CNTK::operator==(const Axis& first, const Axis& second); // %rename (AreEqualAxis) CNTK::operator==(const Axis& first, const Axis& second);
%ignore_function CNTK::Axis::DefaultDynamicAxis(); %ignore_function CNTK::Axis::DefaultDynamicAxis();
%ignore_function CNTK::Axis::OperandSequenceAxis(); %ignore_function CNTK::Axis::OperandSequenceAxis();
%ignore_function CNTK::Axis::DefaultBatchAxis(); %ignore_function CNTK::Axis::DefaultBatchAxis();
@ -412,6 +414,8 @@ SWIG_STD_VECTOR_ENHANCED(CNTK::DeviceDescriptor)
%ignore_function CNTK::Axis::DefaultInputVariableDynamicAxes(); %ignore_function CNTK::Axis::DefaultInputVariableDynamicAxes();
%ignore_function CNTK::Axis::UnknownDynamicAxes(); %ignore_function CNTK::Axis::UnknownDynamicAxes();
%rename(AreEqual) operator==;
// class Function // class Function
%ignore CNTK::Function::BlockArgumentsMapping; %ignore CNTK::Function::BlockArgumentsMapping;
%rename (GetName) CNTK::Function::Name; %rename (GetName) CNTK::Function::Name;
@ -497,13 +501,13 @@ SWIG_STD_VECTOR_ENHANCED(CNTK::DeviceDescriptor)
%rename (_IsConstant) CNTK::Variable::IsConstant; %rename (_IsConstant) CNTK::Variable::IsConstant;
%rename (_IsPlaceholder) CNTK::Variable::IsPlaceholder; %rename (_IsPlaceholder) CNTK::Variable::IsPlaceholder;
%rename (GetOwner) CNTK::Variable::Owner; %rename (GetOwner) CNTK::Variable::Owner;
%rename (AreEqualVariable) CNTK::operator==(const Variable& first, const Variable& second); // %rename (AreEqualVariable) CNTK::operator==(const Variable& first, const Variable& second);
// class NDShape // class NDShape
%rename (GetDimensions) CNTK::NDShape::Dimensions; %rename (GetDimensions) CNTK::NDShape::Dimensions;
%rename (GetRank) CNTK::NDShape::Rank; %rename (GetRank) CNTK::NDShape::Rank;
%rename (GetTotalSize) CNTK::NDShape::TotalSize; %rename (GetTotalSize) CNTK::NDShape::TotalSize;
%rename (AreEqualShape) CNTK::operator==(const NDShape& first, const NDShape& second); // %rename (AreEqualShape) CNTK::operator==(const NDShape& first, const NDShape& second);
%rename (_IsUnknown) CNTK::NDShape::IsUnknown; %rename (_IsUnknown) CNTK::NDShape::IsUnknown;
%rename (_HasInferredDimension) CNTK::NDShape::HasInferredDimension; %rename (_HasInferredDimension) CNTK::NDShape::HasInferredDimension;
%rename (_HasFreeDimension) CNTK::NDShape::HasFreeDimension; %rename (_HasFreeDimension) CNTK::NDShape::HasFreeDimension;

Просмотреть файл

@ -7,6 +7,10 @@
%include "CNTKManagedCommon.i" %include "CNTKManagedCommon.i"
// Operator overloading is not supported by Python.
// %rename(eq) operator==;
// %rename(eq) operator==;
// C# specific extenstion // C# specific extenstion
%typemap(cscode) CNTK::DeviceDescriptor %{ %typemap(cscode) CNTK::DeviceDescriptor %{
public int Id public int Id
@ -59,7 +63,7 @@
} }
// Return true if the fields match: // Return true if the fields match:
return CNTKLib.AreEqualDeviceDescriptor(this, p); return CNTKLib.AreEqual(this, p);
} }
public bool Equals(DeviceDescriptor p) public bool Equals(DeviceDescriptor p)
@ -71,7 +75,7 @@
} }
// Return true if the fields match: // Return true if the fields match:
return CNTKLib.AreEqualDeviceDescriptor(this, p); return CNTKLib.AreEqual(this, p);
} }
public override int GetHashCode() public override int GetHashCode()
@ -140,7 +144,7 @@
} }
// Return true if the fields match: // Return true if the fields match:
return CNTKLib.AreEqualAxis(this, p); return CNTKLib.AreEqual(this, p);
} }
public bool Equals(Axis p) public bool Equals(Axis p)
@ -152,7 +156,7 @@
} }
// Return true if the fields match: // Return true if the fields match:
return CNTKLib.AreEqualAxis(this, p); return CNTKLib.AreEqual(this, p);
} }
public override int GetHashCode() public override int GetHashCode()
@ -415,7 +419,7 @@
} }
// Return true if the fields match: // Return true if the fields match:
return CNTKLib.AreEqualVariable(this, p); return CNTKLib.AreEqual(this, p);
} }
public bool Equals(Variable p) public bool Equals(Variable p)
@ -427,7 +431,7 @@
} }
// Return true if the fields match: // Return true if the fields match:
return CNTKLib.AreEqualVariable(this, p); return CNTKLib.AreEqual(this, p);
} }
public override int GetHashCode() public override int GetHashCode()
@ -546,7 +550,7 @@
} }
// Return true if the fields match: // Return true if the fields match:
return CNTKLib.AreEqualShape(this, p); return CNTKLib.AreEqual(this, p);
} }
public bool Equals(NDShape p) public bool Equals(NDShape p)
@ -558,7 +562,7 @@
} }
// Return true if the fields match: // Return true if the fields match:
return CNTKLib.AreEqualShape(this, p); return CNTKLib.AreEqual(this, p);
} }
public override int GetHashCode() public override int GetHashCode()

Просмотреть файл

@ -45,12 +45,12 @@
if (o == null) return false; if (o == null) return false;
DeviceDescriptor p = (DeviceDescriptor)o; DeviceDescriptor p = (DeviceDescriptor)o;
if (p == null) return false; if (p == null) return false;
return CNTKLib.AreEqualDeviceDescriptor(this, p); return CNTKLib.AreEqual(this, p);
} }
public boolean equals(DeviceDescriptor p) { public boolean equals(DeviceDescriptor p) {
if (p == null) return false; if (p == null) return false;
return CNTKLib.AreEqualDeviceDescriptor(this, p); return CNTKLib.AreEqual(this, p);
} }
@Override @Override
@ -66,12 +66,12 @@
if (o == null) return false; if (o == null) return false;
Axis p = (Axis)o; Axis p = (Axis)o;
if (p == null) return false; if (p == null) return false;
return CNTKLib.AreEqualAxis(this, p); return CNTKLib.AreEqual(this, p);
} }
public boolean equals(Axis p) { public boolean equals(Axis p) {
if (p == null) return false; if (p == null) return false;
return CNTKLib.AreEqualAxis(this, p); return CNTKLib.AreEqual(this, p);
} }
@Override @Override
@ -138,12 +138,12 @@
if (o == null) return false; if (o == null) return false;
Variable p = (Variable)o; Variable p = (Variable)o;
if (p == null) return false; if (p == null) return false;
return CNTKLib.AreEqualVariable(this, p); return CNTKLib.AreEqual(this, p);
} }
public boolean equals(Variable p) { public boolean equals(Variable p) {
if (p == null) return false; if (p == null) return false;
return CNTKLib.AreEqualVariable(this, p); return CNTKLib.AreEqual(this, p);
} }
@Override @Override
@ -167,12 +167,12 @@
if (o == null) return false; if (o == null) return false;
NDShape p = (NDShape)o; NDShape p = (NDShape)o;
if (p == null) return false; if (p == null) return false;
return CNTKLib.AreEqualShape(this, p); return CNTKLib.AreEqual(this, p);
} }
public boolean equals(NDShape p) { public boolean equals(NDShape p) {
if (p == null) return false; if (p == null) return false;
return CNTKLib.AreEqualShape(this, p); return CNTKLib.AreEqual(this, p);
} }
@Override @Override