Class: CNTK::BackPropState
- Inherits:
-
Object
- Object
- CNTK::BackPropState
- Defined in:
- ext/cntk/cntk_wrap.cxx
Instance Method Summary collapse
Instance Method Details
#device(*args) ⇒ Object
31194 31195 31196 31197 31198 31199 31200 31201 31202 31203 31204 31205 31206 31207 31208 31209 31210 31211 31212 31213 31214 31215 31216 31217 31218 31219 31220 31221 31222 31223 31224 31225 31226 31227 31228 31229 31230 31231 31232 31233 31234 31235 31236 31237 31238 31239 31240 31241 31242 31243 31244 31245 |
# File 'ext/cntk/cntk_wrap.cxx', line 31194
SWIGINTERN VALUE
_wrap_BackPropState_device(int argc, VALUE *argv, VALUE self) {
CNTK::BackPropState *arg1 = (CNTK::BackPropState *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
std::shared_ptr< CNTK::BackPropState > tempshared1 ;
std::shared_ptr< CNTK::BackPropState > *smartarg1 = 0 ;
CNTK::DeviceDescriptor *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
{
swig_ruby_owntype newmem = {
0, 0
};
res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__BackPropState_t, 0 | 0 , &newmem);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::BackPropState *","device", 1, self ));
}
if (newmem.own & SWIG_CAST_NEW_MEMORY) {
tempshared1 = *reinterpret_cast< std::shared_ptr< CNTK::BackPropState > * >(argp1);
delete reinterpret_cast< std::shared_ptr< CNTK::BackPropState > * >(argp1);
arg1 = const_cast< CNTK::BackPropState * >(tempshared1.get());
} else {
smartarg1 = reinterpret_cast< std::shared_ptr< CNTK::BackPropState > * >(argp1);
arg1 = const_cast< CNTK::BackPropState * >((smartarg1 ? smartarg1->get() : 0));
}
}
{
try {
result = (CNTK::DeviceDescriptor *)CNTK_BackPropState_device(arg1);
}
catch (const std::runtime_error &e) {
SWIG_exception(SWIG_RuntimeError,e.what());
}
catch (const std::invalid_argument &e) {
SWIG_exception(SWIG_ValueError,e.what());
}
catch (const std::logic_error &e) {
SWIG_exception(SWIG_RuntimeError,e.what());
}
catch (...) {
SWIG_exception(SWIG_UnknownError,"Runtime exception");
}
}
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CNTK__DeviceDescriptor, SWIG_POINTER_OWN | 0 );
return vresult;
fail:
return Qnil;
}
|
#function(*args) ⇒ Object
31083 31084 31085 31086 31087 31088 31089 31090 31091 31092 31093 31094 31095 31096 31097 31098 31099 31100 31101 31102 31103 31104 31105 31106 31107 31108 31109 31110 31111 31112 31113 31114 31115 31116 31117 31118 31119 31120 31121 31122 31123 31124 31125 31126 31127 31128 31129 31130 31131 31132 31133 31134 31135 31136 31137 |
# File 'ext/cntk/cntk_wrap.cxx', line 31083
SWIGINTERN VALUE
_wrap_BackPropState_function(int argc, VALUE *argv, VALUE self) {
CNTK::BackPropState *arg1 = (CNTK::BackPropState *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
std::shared_ptr< CNTK::BackPropState > tempshared1 ;
std::shared_ptr< CNTK::BackPropState > *smartarg1 = 0 ;
CNTK::FunctionPtr result;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
{
swig_ruby_owntype newmem = {
0, 0
};
res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__BackPropState_t, 0 | 0 , &newmem);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::BackPropState *","Function", 1, self ));
}
if (newmem.own & SWIG_CAST_NEW_MEMORY) {
tempshared1 = *reinterpret_cast< std::shared_ptr< CNTK::BackPropState > * >(argp1);
delete reinterpret_cast< std::shared_ptr< CNTK::BackPropState > * >(argp1);
arg1 = const_cast< CNTK::BackPropState * >(tempshared1.get());
} else {
smartarg1 = reinterpret_cast< std::shared_ptr< CNTK::BackPropState > * >(argp1);
arg1 = const_cast< CNTK::BackPropState * >((smartarg1 ? smartarg1->get() : 0));
}
}
{
try {
result = (arg1)->Function();
}
catch (const std::runtime_error &e) {
SWIG_exception(SWIG_RuntimeError,e.what());
}
catch (const std::invalid_argument &e) {
SWIG_exception(SWIG_ValueError,e.what());
}
catch (const std::logic_error &e) {
SWIG_exception(SWIG_RuntimeError,e.what());
}
catch (...) {
SWIG_exception(SWIG_UnknownError,"Runtime exception");
}
}
{
std::shared_ptr< CNTK::Function > *smartresult = result ? new std::shared_ptr< CNTK::Function >(result) : 0;
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(smartresult), SWIGTYPE_p_std__shared_ptrT_CNTK__Function_t, SWIG_POINTER_OWN);
}
return vresult;
fail:
return Qnil;
}
|
#saved_forward_prop_values(*args) ⇒ Object
31140 31141 31142 31143 31144 31145 31146 31147 31148 31149 31150 31151 31152 31153 31154 31155 31156 31157 31158 31159 31160 31161 31162 31163 31164 31165 31166 31167 31168 31169 31170 31171 31172 31173 31174 31175 31176 31177 31178 31179 31180 31181 31182 31183 31184 31185 31186 31187 31188 31189 31190 31191 |
# File 'ext/cntk/cntk_wrap.cxx', line 31140
SWIGINTERN VALUE
_wrap_BackPropState_saved_forward_prop_values(int argc, VALUE *argv, VALUE self) {
CNTK::BackPropState *arg1 = (CNTK::BackPropState *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
std::shared_ptr< CNTK::BackPropState > tempshared1 ;
std::shared_ptr< CNTK::BackPropState > *smartarg1 = 0 ;
std::unordered_map< CNTK::Variable,CNTK::ValuePtr,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::ValuePtr > > > *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
{
swig_ruby_owntype newmem = {
0, 0
};
res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__BackPropState_t, 0 | 0 , &newmem);
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::BackPropState *","SavedForwardPropValues", 1, self ));
}
if (newmem.own & SWIG_CAST_NEW_MEMORY) {
tempshared1 = *reinterpret_cast< std::shared_ptr< CNTK::BackPropState > * >(argp1);
delete reinterpret_cast< std::shared_ptr< CNTK::BackPropState > * >(argp1);
arg1 = const_cast< CNTK::BackPropState * >(tempshared1.get());
} else {
smartarg1 = reinterpret_cast< std::shared_ptr< CNTK::BackPropState > * >(argp1);
arg1 = const_cast< CNTK::BackPropState * >((smartarg1 ? smartarg1->get() : 0));
}
}
{
try {
result = (std::unordered_map< CNTK::Variable,CNTK::ValuePtr,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::ValuePtr > > > *) &(arg1)->SavedForwardPropValues();
}
catch (const std::runtime_error &e) {
SWIG_exception(SWIG_RuntimeError,e.what());
}
catch (const std::invalid_argument &e) {
SWIG_exception(SWIG_ValueError,e.what());
}
catch (const std::logic_error &e) {
SWIG_exception(SWIG_RuntimeError,e.what());
}
catch (...) {
SWIG_exception(SWIG_UnknownError,"Runtime exception");
}
}
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__unordered_mapT_CNTK__Variable_std__shared_ptrT_CNTK__Value_t_std__hashT_CNTK__Variable_t_std__equal_toT_CNTK__Variable_t_std__allocatorT_std__pairT_CNTK__Variable_const_std__shared_ptrT_CNTK__Value_t_t_t_t, 0 | 0 );
return vresult;
fail:
return Qnil;
}
|