Module: Torch::Inspector

Included in:
Tensor
Defined in:
lib/torch/inspector.rb

Defined Under Namespace

Classes: Formatter

Constant Summary collapse

{
  precision: 4,
  threshold: 1000,
  edgeitems: 3,
  linewidth: 80,
  sci_mode: nil
}

Instance Method Summary collapse

Instance Method Details

#inspectObject



117
118
119
120
121
122
123
124
125
# File 'lib/torch/inspector.rb', line 117

def inspect
  Torch.no_grad do
    str_intern(self)
  end
rescue => e
  # prevent stack error
  puts e.backtrace.join("\n")
  "Error inspecting tensor: #{e.inspect}"
end