Class: Tensorflow::Int

Inherits:
Object
  • Object
show all
Defined in:
ext/Tensorflow_wrap.cxx

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Object


15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
# File 'ext/Tensorflow_wrap.cxx', line 15355

SWIGINTERN VALUE
_wrap_new_Int(int argc, VALUE *argv, VALUE self) {
  size_t arg1 ;
  size_t val1 ;
  int ecode1 = 0 ;
  Int *result = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "size_t","Int", 1, argv[0] ));
  } 
  arg1 = static_cast< size_t >(val1);
  result = (Int *)new_Int(arg1);
  DATA_PTR(self) = result;
  return self;
fail:
  return Qnil;
}

Class Method Details

.frompointer(*args) ⇒ Object


15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
# File 'ext/Tensorflow_wrap.cxx', line 15498

SWIGINTERN VALUE
_wrap_Int_frompointer(int argc, VALUE *argv, VALUE self) {
  int *arg1 = (int *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  Int *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_int, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "int *","Int_frompointer", 1, argv[0] )); 
  }
  arg1 = reinterpret_cast< int * >(argp1);
  result = (Int *)Int_frompointer(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Int, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}

Instance Method Details

#[](*args) ⇒ Object

call-seq:

[](index) -> int

Element accessor/slicing.


15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
# File 'ext/Tensorflow_wrap.cxx', line 15396

SWIGINTERN VALUE
_wrap_Int___getitem__(int argc, VALUE *argv, VALUE self) {
  Int *arg1 = (Int *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  int result;
  VALUE vresult = Qnil;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Int, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Int *","__getitem__", 1, self )); 
  }
  arg1 = reinterpret_cast< Int * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","__getitem__", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  result = (int)Int___getitem__(arg1,arg2);
  vresult = SWIG_From_int(static_cast< int >(result));
  return vresult;
fail:
  return Qnil;
}

#[]=(*args) ⇒ Object

call-seq:

[]=(index, value)

Element setter/slicing.


15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
# File 'ext/Tensorflow_wrap.cxx', line 15437

SWIGINTERN VALUE
_wrap_Int___setitem__(int argc, VALUE *argv, VALUE self) {
  Int *arg1 = (Int *) 0 ;
  size_t arg2 ;
  int arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  int val3 ;
  int ecode3 = 0 ;
  
  if ((argc < 2) || (argc > 2)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Int, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Int *","__setitem__", 1, self )); 
  }
  arg1 = reinterpret_cast< Int * >(argp1);
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","__setitem__", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  ecode3 = SWIG_AsVal_int(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","__setitem__", 3, argv[1] ));
  } 
  arg3 = static_cast< int >(val3);
  Int___setitem__(arg1,arg2,arg3);
  return Qnil;
fail:
  return Qnil;
}

#cast(*args) ⇒ Object


15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
# File 'ext/Tensorflow_wrap.cxx', line 15474

SWIGINTERN VALUE
_wrap_Int_cast(int argc, VALUE *argv, VALUE self) {
  Int *arg1 = (Int *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  int *result = 0 ;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Int, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Int *","cast", 1, self )); 
  }
  arg1 = reinterpret_cast< Int * >(argp1);
  result = (int *)Int_cast(arg1);
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int, 0 |  0 );
  return vresult;
fail:
  return Qnil;
}